473,473 Members | 2,319 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

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

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)
Jul 21 '05 #1
1 1652
"Kevin R" <ru******@darden.virginia.edu> wrote in
news:ev**************@TK2MSFTNGP15.phx.gbl:
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?


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
--
Hope this helps.

Chris.
-------------
C.R. Timmons Consulting, Inc.
http://www.crtimmonsinc.com/
Jul 21 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Oleg Paraschenko | last post by:
Hello colleagues, I'd like to introduce you TeXML, the XML vocabulary for TeX: http://getfo.org/texml/ http://getfo.sourceforge.net/texml/ A processor translates TeXML source into TeX. |...
4
by: Drew Lettington | last post by:
I'm making a simple call to display error messages in a MessageBox from a Windows form and the MessageBox is not behaving in a modal fashion. My modal form displays, the user clicks a button and...
11
by: Rich Tasker | last post by:
I have a strange situation. A simple call to MessageBox.Show("XXX", "YYY") does not display the message in the messagebox with a visible font. Based on the content of the messagebox, the box...
4
by: Mystery Man | last post by:
We have developed a CSharp program that has a secondary thread that is used to perform background operations. This secondary thread may display some MessageBoxes or Forms. However, if the...
1
by: Ori | last post by:
Hi Guys, Here is my problem, but maybe someone can help me with this. Background: 1. Using C#. 2. I'm having a form which the KeyPreview is on (and must stay like this) and I'm...
13
by: Jason Huang | last post by:
Hi, Would someone explain the following coding more detail for me? What's the ( ) for? CurrentText = (TextBox)e.Item.Cells.Controls; Thanks. Jason
20
by: Peter E. Granger | last post by:
I'm having a strange problem (or at least it seems strange to me) trying to display a MessageBox in a VC++ .NET forms application. If I put the call to MessageBox::Show in the form's .h file, it...
5
by: Curt Emich | last post by:
I always thought writing a simple diagnostic message in a message box would be pretty simple. Not in .NET. First, I wrote this amazingly complex piece of code: MessageBox.Show("yer mama") ...
1
by: Kevin R | last post by:
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...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
1
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.