Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Odd Behavior 2

Status
Not open for further replies.

spiego

MIS
Aug 16, 2004
80
US
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:
Code:
 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.
 
VB6 used to do that if you were running out of memory. Not sure about .Net, but I've never run into it. Are you using a custom font? or screen colors?

-Rick

----------------------

[monkey] I believe in killer coding ninja monkeys.[monkey]
 
The first depends on the OS. If it's XP then the shortcuts will show when you press 'Alt'

The second one is very odd and may be due to an OS glitch which could be corrected by a restart. Or it could be a virus or a bad installation.

With older OS's a chronic lack of memory could cause behaviour like you mentioned but I've never seen this with XP.
 
Thanks to both of you for you input. The machine itself has 512MB of memory and has all of the latest Microsoft updates. The install did not error on my at all. As for custom fonts or screen colors, I am using the windows defaults. I haven't tried the restart, but will when I get home.
 
Well, the reboot did not work. I should have also mentioned that when I run the app and the form is displayed, the text on the form shows up just fine.

Any other suggestions?
 
two extra items for rick's list...

rebuild

institutionalization

the last doesn't really fix the problem but can be an attractive option sometimes.
 
do any other programs display this behavior? can you make a new project and have the same results?

-Rick

----------------------

[monkey] I believe in killer coding ninja monkeys.[monkey]
 
Try this:
Code:
MessageBox.Show("Hello There", "My Application", _
           MessageBoxButtons.OKCancel, MessageBoxIcon.Asterisk)
(your earlier code sample had some casing problems)

Chip H.



____________________________________________________________________
Click here to learn Ways to help with Tsunami Relief
If you want to get the best response to a question, please read FAQ222-2244 first
 
I tried your code, Chip, but no luck. When I run it, the text "My Application" shows up in the title bar and the information icon displays, but that's it. The text "Hello There" does not display and the text for the OK and Cancel buttons do not display either. Maybe I should try to reinstall it.
 
OMG, I completely forgot about the McAffee issue! doh! If you are running McAffee make sure you have it patched and uptodate. There is an issue where it makes the text on message boxes in .Net not appear!

-Rick

----------------------

[monkey] I believe in killer coding ninja monkeys.[monkey]
 
Thanks for the valuable info. It just so happens that I am running McAfee v8.0i. I will give it a try tonight and let you know what happens.
 
God bless the Internet!!! The McAfee hotfix worked. Thank you very much.
 
This was a major issue a few months back when McAfee released the offending piece of software. Saw posts about it almost every day.

-Rick

----------------------

[monkey] I believe in killer coding ninja monkeys.[monkey]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top