How to bring my application to the front?

后端 未结 8 661
孤城傲影
孤城傲影 2020-12-08 15:32

I know all the reasons why it is a bad idea. I dislike it if an application steals input focus, but this is for purely personal use and I want it to happen; it will not dist

8条回答
  •  醉梦人生
    2020-12-08 16:05

    Assuming that there are no other StayOnTop applications running you can temporarily set your forms FormStyle to be fsStayOnTop and then do an Application Restore and BringToFront and then change the formstyle back to whatever it was.

    tmpFormStyle := Application.MainForm.FormStyle;
    Application.MainForm.FormStyle := fsStayOnTop;
    Application.Restore; // optional
    Application.BringToFront;
    Application.MainForm.FormStyle := tmpFormStyle;
    

    Again, this only works if there are no other stayontop applications.

提交回复
热议问题