How to keep window to stay on top of application?

G

Guest

I'd like windows spawned off my by main window to always stay above that main
window, even when you give focus to it... how would I do this? The only
property I find is one which makes that window stay on top of EVERYTHING,
including outside apps... I just want the windows to stay on top of my main
window so that when the user focuses on the main window, the sub windows
don't get lost (I don't put them in taskbar)
 
M

Mohamoss

Hi
Let me state what I think you want to do . you want one form of yours to
be on top of other forms of your application ( but not if you change focus
to other application )

if that , what you can do is open it modally . Use the function showDialog
( and you can ignore the returned dialog result if you are not going to use
it ) instead of the normal show function to show that dialog.

http://msdn.microsoft.com/library/en-us/cpref/html/frlrfsystemwindowsformsfo
rmclassshowdialogtopic.asp
Mohamed Mahfouz
MEA Developer Support Center
ITworx on behalf of Microsoft EMEA GTSC
 
G

Guest

Yeah but if I make it modal then the user cannot access anything on my 'main'
application window, because modal forces focus on only that window... right?
 
D

Doug Forster

Hi,

If you want a modeless window to stay above another window just set its
Owner property as the other window before you show it.

Cheers

Doug Forster
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top