Odd Behavior

spiego

Member
Joined
Mar 28, 2005
Messages
5
Programming Experience
10+
I just installed VB.Net Pro on my XP Pro box and wrote a very simple app that is to display a form with two buttons, OK and Exit. Each button has a shortcut key assigned to it. When the OK button is pressed, a message box is to appear with a text message on it.

Here is the odd behavior. First, when I run the app the shortcut keys do not appear on the buttons (even though they show up in design mode). Second, when I click on OK, the message box appears, but the text does not show up nor does the text "OK" appear on the default button of the message box.

Here is the code that I have within the click procedure of the OK button:
Messagebox.show("Hello")

As you can see, it's a very simple app, but I'm not sure why it is behaving this way and it makes it difficult to write more complex apps. Your help is greatly needed and appreciated.
 

TPM

Well-known member
Joined
Dec 7, 2004
Messages
623
Location
CA
Programming Experience
3-5
The shortcut keys will probably show when you press Alt.
Your message box doesn't say hello? Hmm that is strange. What if you try messagebox.show("Hello","", messageboxbuttons.ok) Does that work?

TPM
 

spiego

Member
Joined
Mar 28, 2005
Messages
5
Programming Experience
10+
I haven't tried pressing the Alt key, but I will. As for the message box, I've even tried MessageBox.show("Hello","This is the title",messageboxbuttons.ok) and still nothing except that the text "This is the title" shows up in the title bar.
 

TPM

Well-known member
Joined
Dec 7, 2004
Messages
623
Location
CA
Programming Experience
3-5
Hmm freeky. Is there a button (with out the ok in it)? Maybe its some weird font problem...
 

spiego

Member
Joined
Mar 28, 2005
Messages
5
Programming Experience
10+
Yes, the button appears but the OK text does not display. If it's a font issue, where do you suggest that I begin to look? FYI - If I place text on the form, it shows up just fine. It's just with the message box.
 

TPM

Well-known member
Joined
Dec 7, 2004
Messages
623
Location
CA
Programming Experience
3-5
Make sure all the windows fonts are installed. Is your VB version 2003?
 

spiego

Member
Joined
Mar 28, 2005
Messages
5
Programming Experience
10+
It's version 2003. In fact, it's actually Visual Studio 2003. How can I tell if all of the fonts are installed?
 

eagle

Active member
Joined
Mar 8, 2005
Messages
28
Programming Experience
1-3
Use msgBox("Hello")

And what happens when you use
msgBox("Hello")

Because messageBox normally depends on your GUI, but a msgBox is always given, so try this one if you can.
 

TPM

Well-known member
Joined
Dec 7, 2004
Messages
623
Location
CA
Programming Experience
3-5
Ok good. What about your framwork version? Goto control panel and then Fonts. Just check the main ones, arial etc. (sorry I don't know which one messagebox uses)

MsgBox is lft over from VB6 so if you can avoid using it I would, but worth a try.
 

spiego

Member
Joined
Mar 28, 2005
Messages
5
Programming Experience
10+
God bless the Internet!!! I posted my predicament on another forum and someone responded with the answer, which they got from another forum. The problem is due to a bug with McAfee v8.01 and the buffer overun. Read the second to last post on this page:
http://p2p.wrox.com/topic.asp?whichpage=1&TOPIC_ID=18921&#61286

I installed the hotfix and now it works like it should.

Thanks to all for your input.
 
Top Bottom