O'Reilly logo

Visual Basic® .NET by Example by Bob Donald, Gabriel Oancea

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Message Boxes

Occasionally, you as a developer may want to show a textual message to the user of your application. You may even want to ask a question at a strategic point in your code. Message boxes are the standard way of presenting messages to users, and they allow you to ask questions of the user and get their responses. The System.Windows.Forms.MessageBox class is provided as part of the .NET Framework for the exact purpose of informing the user and eliciting user responses.

To show a message to the user, you can call the shared Show method of the System.Windows.Forms.MessageBox class. The following code displays a basic message to the user and Figure 22.19 shows the output of this code:

MessageBox.Show("This is a message.")
Figure 22.19. ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required