MessageBox quirk - msgbox.jpg (0/1)

M

Marc Jennings

Hi,

I have a problem with the message text and button text not showing up
in a messagebox. (See attachment)

The code I used to call this example was
MessageBox.Show(this,"Hello","nothing shown",MessageBoxButtons.OK,MessageBoxIcon.Information);

I had this problem a couple of weeks ago when I was running Windows
2003 Server on my dev machine, and I put it down to an OS / Framework
problem. I have since rebuilt the dev machine with XP SP1 (SP2 has
never been near this build), and the problem is still here.

Immediate thoughts would be a graphiocs card driver problem, but
messageboxes from other commercial apps work fine.

I am confused. Can anyone help?
 
M

Marc Jennings

My newsreader software seems to have posted the image as a separate
post. Sorry about that.

I have just tried the windows standard drivers for the display in the
dev amchine and there was no improvement (I had done this bofore, but
I wanted to double check the result). Drivers don't seem to be the
issue, then.

(The compiled app runs fine on another machine, so it must be
something specific to my dev box.)
 
K

Kevin Yu [MSFT]

Hi Marc,

First of all, I would like to confirm my understanding of your issue. From
your description, I understand that the text in the MessageBox is not
showing properly on your dev box. If there is any misunderstanding, please
feel free to let me know.

This problem seems to be machine specific. Could you try to reproduce it
with some simple steps?

1. Using the app wizard, create a new C# app. (Select "Windows Application"
in the New Project diailog.)
2. Drag and drop a button on the form.
3. Double-click on the button to generate an event handler for the button.
4. Enter the following line of code to the event handler:
MessageBox.Show("Hello!");
5. Run the application, and click the button which was added to the form.

If so, I think there might be something wrong with the .NET framework
installation. Could you try to re-install the .NET framework?

Kevin Yu
=======
"This posting is provided "AS IS" with no warranties, and confers no
rights."
 
M

Marc Jennings

That is eactly what happens. Any time I call a message box (I can do
it on Form_Load, from a button, at startup, anywhere...) I get the
same result. The title of the messagebox is fine, the icon (if
specified) is ok, the outline of the button(s) is ok, but the text,
and button text do not show up.

I will try to re-install the framework, but this has happened on two
installations on the same box, from different media.

I'll keep trying, though.
 
M

Marc Jennings

Reinstalled the framework - no difference.
Reinstalled the framework from a different source - no change
removed video drivers to use windows default - no change
tried different version of the video driver - no change

Also, any items in a listbox control do not show up either. I am most
perplexed.
 
M

Martin Dechev

Hi,

Looks like the font used to display these texts (usually Tahoma) is messed
up, or the color for the text is set to the value of the background color.
Check it in the Appearance settings for your desktop. If the color is ok try
setting different font for the messageboxes. If this helps with the
messageboxes - try to replace the problematic (previous) font with the
original one in the Windows installation CD.

Hope this helps
Martin Dechev
ASP.NET MVP
 
M

Marc Jennings

Thanks. I tried, but there was no difference. I also checked the
exact size of the font file against a known good one, and it was the
same (message boxes from non-dotnet apps seem to work fine with Tahoma
as the default font)
 
K

Kevin Yu [MSFT]

Hi Marc,

Looking at the nature of this issue, it would require intensive
troubleshooting which would be done quickly and effectively with direct
assistance from a Microsoft Support Professional through Microsoft Product
Support Services. You can contact Microsoft Product Support directly to
discuss additional support options you may have available, by contacting us
at 1-(800)936-5800 or by choosing one of the options listed at
http://support.microsoft.com/default.aspx?scid=sz;en-us;top. If this is not
an urgent issue and you would like us to create an incident for you and
have Microsoft Customer Service Representative contact you directly, please
send email to (remove "online." from this no Spam email address):
mailto:[email protected] with the following information,

* Include "Followup: <Tomcat IssueID>" in the email Subject.
*Location of the post
*Subject Line
* First Name, Last Name
*MSDN Subscriber ID
*Company name (if any)
*Phone number
*e-mail address

Kevin Yu
=======
"This posting is provided "AS IS" with no warranties, and confers no
rights."
 
S

Sami Vaaraniemi

Just a wild guess, but you do have the STAThread attribute attached to the
Main method, do you? Some system dialogs require the calling thread to be in
STA and it is known to cause odd behavior if you leave the attribute out.

Regards,
Sami
 
G

Guest

I am not 100% sure what you mean, to be honest. I assume you mean having
[STAThread] immediately prior to the Main method? if so, then yes, I do.
 
M

Marc Jennings

Ianhoc found the solution to this problem and posted it in a thread
entitled "MessageBox blank"
It seems McAfee Version 8 is the culprit - disable buffer overrun and all is
okay again.

Go figure!!

Fantastic. Thanks Ianhoc. (I only wish I could put back all the hair
I have torn out over this problem. :( )
 
K

Kevin Yu [MSFT]

Hi Marc,

Thanks for sharing your experience with all the people here. If you have
any questions, please feel free to post them in the community.

Kevin Yu
=======
"This posting is provided "AS IS" with no warranties, and confers no
rights."
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top