Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / Windows Forms / WinForm General / September 2004

Tip: Looking for answers? Try searching our database.

Issue with messageBox

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Mukesh - 28 Sep 2004 20:39 GMT
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

Rate this thread:







Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.