How to Access the Visual Basic MsgBox With Option Group

The Visual Basic "MsgBox" is a function internal to the programming language that allows you to show a message to the user. The MsgBox function displays an alert in a dialog box. The MsgBox function has a "options" group that changes the icon associated with the message and the title of the window when it displays.

Instructions

    • 1

      Right-click the Visual Basic form file you want to edit. Select "Open With." In the list of software, choose "Visual Studio." This loads the programming software and the software at the same time.

    • 2

      Right-click the form in the console and select "View Code." This displays the form's code where you enter the MsgBox statement.

    • 3

      Type the following code into the form's code file:

      MsgBox("Message", MsgBoxStyle.AbortRetryIgnore,"Title")

      Replace "Message" with the message you want to display to the user. The "MsgBoxStyle.AbortRetryIgnore" and "Title" statements are the options available with the MsgBox function. MsgBoxStyle.AbortRetryIgnore displays the three buttons common on alert dialog boxes, which are "Abort," "Retry" and "Ignore." The "Title" is the text you want to display in the title bar of the window.

    • 4

      Click "Save" to save the code changes. Press the "F5" key, which is the shortcut to run and test the changes in the MsgBox code.

Related Searches:

References

Comments

You May Also Like

Related Ads

Featured