Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

MessageDlg stay on top of form

Status
Not open for further replies.

walkesh

Programmer
Mar 31, 2009
9
US
I have a probem with a MessageDlg box going behind a stay on top form when the application loses focus, I run another program or click on another window on the desktop. Is there a way to make a MessageDlg stay on top? I saw in the help file where you could set a property MB_SYSTEMMODAL or MB_SETFOREGROUND or MB_TOPMOST to get it to stay on top. Our program uses MessageDlg() calls to display messages.Is there anyway to get MessageDlg to stay on top so it doesn't end up behind the main form when the application loses focus.

I am using Delphi 2005.
 
a form with the stay-on-top attribute is one that is set to be on the top of the z-order of forms, especially if it is in the same application. So anything else the application generates tends to go behind it. Try using SetForegroundWindow if you have to have the "stay on top" form stay on top. Or shut off the attribute in the form before you call MessageDlg.

Measurement is not management.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top