Need form to stay on top of parent only

五迷三道 提交于 2019-12-20 10:14:33

问题


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?


回答1:


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

Bye.



来源:https://stackoverflow.com/questions/1411085/need-form-to-stay-on-top-of-parent-only

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!