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

Re: Issue with messageBox by ClayB

ClayB
Wed Sep 29 05:34:32 CDT 2004

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

"Mukesh" <mukeshkapur@yahoo.com> wrote in message
news:eKVPhLZpEHA.1272@TK2MSFTNGP09.phx.gbl...
> 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
>
>



Re: Issue with messageBox by Norman

Norman
Wed Sep 29 09:31:50 CDT 2004

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).


"ClayB [Syncfusion]" <clayb@syncfusion.com> wrote in message
news:uB67y$gpEHA.4008@TK2MSFTNGP14.phx.gbl...
> 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
>
> "Mukesh" <mukeshkapur@yahoo.com> wrote in message
> news:eKVPhLZpEHA.1272@TK2MSFTNGP09.phx.gbl...
> > 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
> >
> >
>
>



Re: Issue with messageBox by Mukesh

Mukesh
Wed Sep 29 10:58:44 CDT 2004

Thanks Norman Yuan & Clay Burch for your input. It was a big help.


"Norman Yuan" <nobody@nowhere.no> wrote in message
news:un4WGEjpEHA.2764@TK2MSFTNGP11.phx.gbl...
> 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).
>
>
> "ClayB [Syncfusion]" <clayb@syncfusion.com> wrote in message
> news:uB67y$gpEHA.4008@TK2MSFTNGP14.phx.gbl...
> > 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
> >
> > "Mukesh" <mukeshkapur@yahoo.com> wrote in message
> > news:eKVPhLZpEHA.1272@TK2MSFTNGP09.phx.gbl...
> > > 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
> > >
> > >
> >
> >
>
>