by Dinesh Thakur Category: Decisions and Conditions

A message box is special type of Visual Basic window in which you can display a message to the user. You can display message, an optional icon, a title bar caption, and command buttons in a message box.


You may want to display a message when the user has entered some invalid data or neglected to enter some required data value.


Message box constant:


vbQuestion : This constant sets a Question marked icon for the message box. It can be used as follows: MsgBox “Lets this be warning”, vbQuestion, “Error”


vbOkOnly: This constant makes message box to appear with only one ok button. Example: MsgBox “Welcome”, vbOkOnly “ Greeting”.


vbInformation: Shows information icon on the message box. Example: MsgBox “Welcome”, vbInformation “ Greeting”.


About Dinesh Thakur

Dinesh ThakurDinesh Thakur holds an B.C.A, MCSE, MCDBA, CCNA, CCNP, A+, SCJP certifications. Dinesh authors the hugely popular blog. Where he writes how-to guides around Computer fundamental , computer software, Computer programming, and web apps. For any type of query or something that you think is missing, please feel free to Contact us.