How to use MsgBox ?

  • Thread starter Nicholas Paldino [.NET/C# MVP]
  • Start date
N

Nicholas Paldino [.NET/C# MVP]

Pronto,

MsgBox is a VB function, not a .NET function. In order to get the same
functionality, call the static Show method on the MessageBox class in the
System.Windows.Forms namespace.

Hope this helps.
 
J

jamie

pronto said:
Hi all,

C#.
I create form with single button.
On button push I want to get MsgBox("Hello world").
What I should do to make compiler understand "MsgBox" ?

regards
pronto

using System.Windows.Forms;

MessageBox.Show("Here is your answer...");


Jamie
 
P

pronto

Hi all,

C#.
I create form with single button.
On button push I want to get MsgBox("Hello world").
What I should do to make compiler understand "MsgBox" ?

regards
pronto
 
P

PseudoBill

Interestingly, MessageBox.Show was modelled on VB's MsgBox. If you
examine the parameters and the possible enum values - they correspond
almost one-to-one with VB's MsgBox.

So, it's not that VB's version is so horrible - it's just that .NET
has a virtually identical version, so you might as well use it. But
I'm willing to bet that under the covers you have the *identical*
.net framework code.
 

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