views:

261

answers:

1

Hi,

I have a multi-window application. My main form is a child of the desktop. My application can create other forms that also become children of the desktop. However, I have a special case where my main form needs to create a form that will always stay on top of it.

I had this working to an extent....however, if I then create other windows in the application this form seems to stay on top of even these!

So basically what I need to know is...

How can I create the form from my main form and make it stay on top of my main form only? Is it possible?

+7  A: 

Hi James Try this

procedure TMainForm.Button1Click(Sender: TObject);
var
f : TForm;
begin
f:=TChildForm.Create(Self);
f.PopupMode:=pmExplicit;
f.PopupParent:=Self;
f.Show;
end;

Bye.

RRUZ
Was actually just about to award the correct answer to Craig Stuntz as he was correct, but he removed for some reason! Thanks.
James
I removed it because I'm less than completely confident that it works correctly with modeless forms (I don't use modeless popups that much). If it works, though, great!
Craig Stuntz
Yeah worked fine Craig thanks.
James
James, Craig Stuntz replied you the same?
RRUZ
Yeah, he said I had to set the PopupMode to explicit and the PopupParent to the main form.
James
ok, now I understand the comments.;)
RRUZ