MsgBox won't show in front of TopMost form

B2Ben

Well-known member
Joined
Aug 17, 2006
Messages
52
Programming Experience
Beginner
As my profile states, I use VS.NET 2005 at home, but I'm working on an App at work using VS.NET 2003...

Anyway... I just added an option to my app to make my main window the topmost window (form1.topmost = true), which works well and is very useful in my application.

However, now my MsgBox'es are hidden behind my main (topmost) form. I can't use the MsgBox'es... all I can do is press Escape to close them. Is there any easy way around this?

If not, would I need to write my own MsgBox function to override the normal one? If so, how would I override a normal function?

Any thoughts? ...thanks in advance :)
 
Clarification... it appears this is only happening with my inputboxes, not MsgBoxes... sorry for the mis-statement
 
You use inputboxes? Amazing.. I dont think, in 6 years, I ever have!

There are plenty of InputBox classes out there to replace the default one, but maybe you can consider how to design your app ithout them?
 
hehe... yes. Only as a temporary solution... I've already built a custom form to get the input I needed. But it just seemed odd that something as basic as an inputbox wouldn't work over a TopMost form.
 
Its implemented by the visualbasic.net team at micirosft, and put into the Microsoft.VisualBasic namespace for legacy compatibility reasons mainly.. Its not actually a core feature of the framework and I think the msot you could do (seeing as the form that implements it isnt marked as TopMost itself?) is to make your form TopMost = false BEFORE you show it, and back again after.. it will stop it being irretrievably buried beneath yours
 
Back
Top