Posts

Showing posts from October, 2013

The MsgBox Function and the MessageBox Class

Image
  The MsgBox Function and the MessageBox Class By: Vikram Singh Rana The message box dialog is one of the most common ways to display custom messages to the user and accept their input regarding the choice that they have made. VB.NET provides two ways to use message boxes: the first is the MsgBox function, which is part of the Microsoft.VisualBasic namespace and is coded in a fashion very similar to pre-.NET versions of VB; the second is the MessageBox class, which has a slightly different syntax, and is the native .NET way to use message boxes. Both methodologies are presented below.   The MsgBox Function   The MsgBox function displays a message in a dialog box, waits for the user to click a button, and returns an Integer indicating which button the user clicked.   Syntax: MsgBox( prompt [, buttons ] [, title ]) - or – IntegerVariable = MsgBox( prompt [, buttons ] [, title ])   The MsgBox function synta