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 / .NET Framework / General / January 2005

Tip: Looking for answers? Try searching our database.

MessageBox does not display 'tex't unless I add extra code.

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Kevin R - 10 Jan 2005 19:28 GMT
I'm running the HelloWorldForm example from Microsoft to learn how to use
.net.  I'm using Microsoft Visual Studio .NET 2003, 1.1 framework.

I run the HelloWorldForm example.  The example runs but the text "Disposed!"
does not appear on the MessageBox.  I can get the text to display if I add
aditional MessageBox switch options.  Is there a reference or something I'm
missing so I don't have to add these options everytime I use the MessageBox?

Thanks!

Kevin R.
==========
Here is the code in the example:
'Called when the Form closes
'Note that the MessageBox call is simply to
'demonstrate that Dispose is called.
'You should keep your Dispose method code as simple and robust as possible

Protected Overloads Overrides Sub Dispose(ByVal disposing As Boolean)
     Try
         MessageBox.Show("Disposed!")
         Catch ex As Exception
    End Try
    MyBase.Dispose(disposing)
End Sub

I modified the code as follows to display the "Disposed" text message.

MessageBox.Show("Disposed!", "Caption", MessageBoxButtons.OK,
MessageBoxIcon.Exclamation, MessageBoxDefaultButton.Button1,
MessageBoxOptions.DefaultDesktopOnly)
Chris R. Timmons - 11 Jan 2005 05:01 GMT
> I'm running the HelloWorldForm example from Microsoft to learn
> how to use .net.  I'm using Microsoft Visual Studio .NET 2003,
[quoted text clipped - 5 lines]
> Is there a reference or something I'm missing so I don't have to
> add these options everytime I use the MessageBox?

Kevin,

It runs fine on my system (same setup as yours).  Try removing the
try/catch handler code.  If an exception is occurring when the
message box code executes, the empty try/catch handler will not allow
the error message to be displayed.

Protected Overloads Overrides Sub Dispose(ByVal disposing As Boolean)
 MessageBox.Show("Disposed!")
 MyBase.Dispose(disposing)
End Sub

Signature

Hope this helps.

Chris.
-------------
C.R. Timmons Consulting, Inc.
http://www.crtimmonsinc.com/


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.