Hi
I just fould a issue with MessgeBox. When i show the messagebox in my
app. Now if the user click any where else on the form out of messagebox. The
click event is kind put in a que. Now if there is a button or other control
where that person clicked, the button / control click event is fired after
my earlier procedure has finished.
Here is how you can duplicate the thing.
- Create a windowsform, put a button control on it,
- Write a procedure onClick event of button
Private Sub button1_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles button1.Click
MessageBox.show("Test", "Test", MessageBoxButtons.OKCancel,
MessageBoxIcon.Question, MessageBoxDefaultButton.Button1,
MessageBoxOptions.DefaultDesktopOnly)
End Sub
- Now Build and run the app
- Click the button
- {move the Messagebox out of the way, so you can see the button}
- click on the button again
- now click any button on the Messagebox
- {Now here is the problem} you will see the message box again. {message box
for second click}
can some tell how disable this feature in my app. or work around.
i have tried disabling the control and also form before displaying the
messagebox but still the same problem.
Can anybody help
Thanks in advance
mk
ClayB [Syncfusion] - 29 Sep 2004 11:34 GMT
I tried your sample and I did see strange behavior, but not exactly what you
described. What I see as I drag the messagebox over the form, the form does
not repaint properly, and wierd things start to happen. I used .NET 1.1 SP1.
When I removed the last argument in the Message.Show call,
MessageBoxOptions.DefaultDesktopOnly, the problem I saw went away.
=========================
Clay Burch, .NET MVP
Visit www.syncfusion.com for the coolest tools
> Hi
> I just fould a issue with MessgeBox. When i show the messagebox in my
[quoted text clipped - 35 lines]
> Thanks in advance
> mk
Norman Yuan - 29 Sep 2004 15:31 GMT
The "Problem" is the argument MessageBoxOptions.DefaultDesktopOnly in
MessageBox.Show() method. If you are calling MessageBox from a Win Form, you
do not use this option.
This Option is basically the same as another option
"MessageBoxOptions.ServiceNotification", used in a process where no form is
presented (no form at all, or maybe, form is hidden).
> I tried your sample and I did see strange behavior, but not exactly what you
> described. What I see as I drag the messagebox over the form, the form does
[quoted text clipped - 47 lines]
> > Thanks in advance
> > mk
Mukesh - 29 Sep 2004 16:58 GMT
Thanks Norman Yuan & Clay Burch for your input. It was a big help.
> The "Problem" is the argument MessageBoxOptions.DefaultDesktopOnly in
> MessageBox.Show() method. If you are calling MessageBox from a Win Form, you
[quoted text clipped - 59 lines]
> > > Thanks in advance
> > > mk