vb.netvisual-studio-2010

Is there a difference between MsgBox and MessageBox.Show?


Is there a difference between the following two?

 msgbox()
 messagebox.show()

Some tutorials use msgbox(), and some use the other, messagebox.show()---I see that both can have an editable style, but I was wondering: Why are there two?

Is it to accommodate older programmers (who have learnt on an older version of Visual Basic)?

So in that case, which one should I use in Visual Basic 2010 (Visual Studio 2010)?


Solution

  • MsgBox() is the same as Messagebox.Show().

    It exists for VB6 programmers who are used to it.

    There are no rules on which one to use, but since MsgBox simply ends up delegating to MessageBox, I personally would go directly with MessageBox.