Bug in C#?

  • Thread starter Thread starter Michael Culley
  • Start date Start date
M

Michael Culley

This is fairly easy to reproduce, create a new exe project, add a second
form Form2, on Form1 add a button and put code under the button to show
form2 modally. Then in the activate event of form2 show a messagebox. Run
the project and click the button then click the OK on the messagebox that
pops up. For some reason the entire app jumps to the back of the z order. If
there are any other apps running then it looks like the app just disappears.

The only solution I could find was to put the messagebox in a timer. Does
anyone know of a better solution? Does anyone know why this happens?

Thanks
Michael Culley
 
Have you tried the MessageBox.Show() with the IWin32Window interface?

MessageBox.Show(this,"Hello World");

It may be that the default message box is getting confused as to who owns
it.

Mike P
 
I've tried that, the result was the same. I've also tried using this.Invoke
with no luck.
 
I think you have something else going on. I can not reproduce your problem.
I had 4 apps running full screen concurrently with the test app and I tried
it with form2 modal & modeless.

I am using:
=========
VS.Net 2003
Framework 1.1
 
MikeP said:
I think you have something else going on. I can not reproduce your problem.
I had 4 apps running full screen concurrently with the test app and I tried
it with form2 modal & modeless.

That is what I'm using too. It might be an OS related issue but I've had it
happen on winXP sp1 and win98. It happened on many different machines in my
app and in the test app. It also happened when running from the IDE or as
release compile. Here is the code I used, would you be able to try it?

Regards,
Michael Culley

http://mikeonline.cable.nu:1863/misc/testzorder.zip
 
Back
Top