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/