Jump to content
Xtreme .Net Talk

Recommended Posts

Posted (edited)

Fyi

 

Its important to remember that MessageBox is defined in the System.Windows.Forms namespace and is fully qualified as

 

System.Windows.Forms.MessageBox

 

and unless you are 'using' System.Windows.Forms in your module, MessageBox will not show up in intellisense without full qualification

Edited by Joe Mamma

Joe Mamma

Amendment 4: The right of the people to be secure in their persons, houses, papers, and effects, against unreasonable searches and seizures, shall not be violated, and no warrants shall issue, but upon probable cause, supported by oath or affirmation, and particularly describing the place to be searched, and the persons or things to be seized.

Amendment 9: The enumeration in the Constitution, of certain rights, shall not be construed to deny or disparage others retained by the people.

  • Leaders
Posted
I don't understand what you are asking. You can use a MessageBox anywhere... you don't even need to have a form... you can just go MessageBox.Show("x") and a messagebox will show up in mid-air. :)

Iceplug, USN

One of my coworkers thinks that I believe that drawing bullets is the most efficient way of drawing bullets. Whatever!!! :-(

Posted
and unless you are 'using' System.Windows.Forms in your module, MessageBox will not show up in intellisense without full qualification

 

What I meant was, if windows forms are not used, can MessageBox be used, for example, can it be used in a console appilication.

Proudly a Palestinian

Microsoft ASP.NET MVP

My Blog: wessamzeidan.net

Posted

Heuuuuuuuu..... perfectly ....

 

Just add the right System.xxxxxx and you'll be in business

"If someone say : "Die mortal !"... don't stay to see if he isn't." - Unknown

"Learning to program is like going out with a new girl friend. There's always something that wasn't mentioned in the documentation..." - Me

"A drunk girl is like an animal... it scream at everything like a cat and roll in the grass like a dog." - Me after seeing my girlfriend drunk and some of her drunk friend.

C# TO VB TRANSLATOR

  • Leaders
Posted

A reference to System.Windows.Forms has to be added (in the references section)... then you can use it. System.Windows.Forms.MessageBox.Show("Hi.") :)

 

It creates its own window, so you don't have to actually be using a Windows Form.

Joe says 'using' for the fact that you can Imports System.Windows.Forms and then you can just say: MessageBox.Show

Iceplug, USN

One of my coworkers thinks that I believe that drawing bullets is the most efficient way of drawing bullets. Whatever!!! :-(

Posted
MessageBox.Show("message")

I was wondering what is the difference between:

MessageBox.Show("message")

and

MsgBox("message")

When is best to use one and when the other, beside already mentioned circumstances.

Posted
MsgBox is really just a legacy function for compatability with VB6 and earlier' date=' MessageBox.Show is the .Net function and as such is the one you should be using.[/quote']

Thanks!

I just started on VB.NET (on programming alltogether as well) and I think it is good to get used to the right way of doing things from the start.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...