msgbox doesn't display prompt text

Z

z

I just installed Visual Studio .Net with Framework 1.1. I already had VB6
SP6 installed.

I wanted to do a quick "hello world" example in VB.Net. The code is here:

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Button1.Click
Dim s As String
Dim r As Long

s = "hello"
r = MsgBox(s, MsgBoxStyle.OKCancel, "a message")
End Sub

The msgbox pops up when you click the button, but the box is empty, and the
buttons have no text on them (saying OK or Cancel), they are just empty grey
buttons. The title does display correctly as "a message". I then ran the
Calc application sample that comes with the .Net install which has a msgbox
when you try to divide by zero, and it's message box and buttons are empty
too.

This appears to be a bug, but am I missing something? There are no service
packs for the 1.1 framework yet.

Any help or knowledge would be appreciated.

z
 
H

Herfried K. Wagner [MVP]

z said:
I wanted to do a quick "hello world" example in VB.Net. The code is here:

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Button1.Click
Dim s As String
Dim r As Long

s = "hello"
r = MsgBox(s, MsgBoxStyle.OKCancel, "a message")
End Sub

The msgbox pops up when you click the button, but the box is empty, and
the
buttons have no text on them (saying OK or Cancel)

Maybe you are using McAfee VirusScan. This product has a bug in its buffer
overflow protection that NAI is aware of and that can be fixed by installing
a patch:

Patch 5 for McAfee VirusScan Enterprise 8.0i
<URL:https://knowledgemap.nai.com/phpclient/viewKDoc.aspx?url=kb/kb_kb38717.xml&docType=DOC_KnowledgeBase>
 
C

Chris, Master of All Things Insignificant

Try using MessageBox.Show(.....) method.

Chris
 
D

dotNETnews

z said:
I just installed Visual Studio .Net with Framework 1.1. I already had VB6
SP6 installed.

I wanted to do a quick "hello world" example in VB.Net. The code is here:

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Button1.Click
Dim s As String
Dim r As Long

s = "hello"
r = MsgBox(s, MsgBoxStyle.OKCancel, "a message")
End Sub
....

Dim s As String
s = "hello"
MessageBox.Show(s, "a message", MessageBoxButtons.OK)
 
Z

z

Outstanding. That is the problem! I disabled buffer overrun in my McAfee
version 8 software and it started working.

Thanks very much, I will try the patch.

z
 
H

Herfried K. Wagner [MVP]

z said:
Outstanding. That is the problem! I disabled buffer overrun in my McAfee
version 8 software and it started working.

I am glad to hear that!
Thanks very much, I will try the patch.

I strongly recomment to install the patch.
 
H

Herfried K. Wagner [MVP]

Bernie Yaeger said:
In .net, use messagebox.show("the message") instead.

Huh?! Why? 'MsgBox' is (still) available and valid part of Visual Basic
..NET (in other words, it's not deprecated).
 
B

Bernie Yaeger

Hi Herfried,

I know it's not deprecated, but messagebox.show is more flexible, in my
opinion.

Bernie
 
Z

z

Bernie,

I wasn't looking for flexibility, I was looking for it to work. See
Herfried's valid solution in the other replies.

z
 

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