Click here to Skip to main content
15,904,153 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Showdialog is a modal window, and messages popping up from its main window are blocked. Show is a non-modal window. When it pops up, its main window message is not masked. How to make the window out of the show always set the top, and the main window message is not shielded?

What I have tried:

i don't konw how to do this function.
Posted
Updated 9-Mar-19 3:11am
Comments
OriginalGriff 9-Mar-19 4:35am    
This is not a good question - we cannot work out from that little what you are trying to do.
Remember that we can't see your screen, access your HDD, or read your mind - we only get exactly what you type to work with. And what you have given us is not clear: what are you trying to get the new window to do, and what is the problem with doing that?

Use the "Improve question" widget to edit your question and provide better information.

I am not sure I understand the question, but maybe you are asking about: Form.TopMost Property (System.Windows.Forms) | Microsoft Docs[^]
 
Share this answer
 
In addition to studying Richard's solution, also examine the ability to set the 'Owner property of a Form to another Form; this will guarantee that the "owned" Form always stays above the "owner" Form.

Setting a Form's 'Topmost property will keep that Form on top of all other app windows, even if another Form is shown modally (using ShowDialog with no owner window handle as a parameter).

But, using MessageBox,Show will appear in front of a 'Topmost window.

i have almost never found a use for making a Form 'Topmost.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900