I've created a messagebox which I want it to stay on top of program when it appears on the screen. It worked normally when I hadn't set my Form to stay on top, but now my msgbox hides under it and it's hard to take it on top to actually see it. Can you set msgbox on top somehow?
Asked
Active
Viewed 487 times
0
-
have you looked here: http://stackoverflow.com/questions/11910448/displaying-a-messagebox-on-top-of-all-forms-setting-location-and-or-color – yossico Oct 06 '13 at 19:20
-
Thanks, yossico but I actually found simple way to do it. "In the line of code just before you show the messagebox set Topmost=false. If you go down the codepath where you decide not to exit set Topmost = true" – Mordehaj Bukarej Oct 06 '13 at 19:49
-
1MessageBox.Show() has overloads that take an *owner*. Pass your form object. – Hans Passant Oct 06 '13 at 20:52
1 Answers
0
If you're creating your own messagebox, use the ShowDialog instead of the Show method to make the messagebox be on top regardless of the Topmost setting. This gives you the advantage of returning different results with different buttons used, the same as the built in messagebox.

tinstaafl
- 6,908
- 2
- 15
- 22