We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date

Hidden MessageBoxes???

Hello- I'm having a very painful problem that has been causing my users to report that my application is locking up. Finally realized that on their machines sometimes MessageBox.Show is putting up the box behind the active form causing a situation where the user can not respond to the box. Of course, I've not been able to replicate on any development machines. I'll point out that my app. does an awful lot of runtime creation and docking of user controls. Also, I don't do any .dispos'ing of my creations and rely totally on the GC. Is this bad?????? Lastly, could MessageBox.Show from events be the problem? Thank You Mike

3 Replies

DT Dave Turrell March 31, 2003 08:19 AM UTC

If you use one of the overloaded show methods you can specify which window to display the message box in front of. Regards Dave > Hello- Mike > > I'm having a very painful problem that has been causing my users to report that my application is locking up. Finally realized that on their machines sometimes MessageBox.Show is putting up the box behind the active form causing a situation where the user can not respond to the box. > > Of course, I've not been able to replicate on any development machines. > > I'll point out that my app. does an awful lot of runtime creation and docking of user controls. Also, I don't do any .dispos'ing of my creations and rely totally on the GC. Is this bad?????? > Lastly, could MessageBox.Show from events be the problem? > > Thank You > Mike

MR Mike Reynolds March 31, 2003 08:35 AM UTC

I actually started specifying the parent as soon as I started seeing the problem. That hasn't helped. I've since created my own Form derived class that mimics the MessageBox functionality and sets itself as Topmost = true. I'm keeping my fingers crossed that this will work. Mike

MI Mike October 17, 2003 01:29 AM UTC

Hi Mike - I am wanting to inherit from messageBox myself to add more to it like a details button that drops down more technical information. I have no idea how to do this besides inheriting from form and then getting an instance of this everytime - I'm interested in what you did and if you know about how to create a static method like .Show() - so that I don't need to get an instance of this class everytime I want to call it. I have workaround ideas of getting a global intance variable of this inherited form and then just calling .ShowDialog() and keep re-using the same instance, but this makes me leary. any advice would be appreciated. Thanks - Michael
Loader.
Live Chat Icon For mobile
Up arrow icon