O'Reilly logo

Visual Basic 2005 for Programmers: Deitel Developer Series, Second Edition by Harvey M. Deitel - Deitel & Associates, Inc., Paul J. Deitel - Deitel & Associates, Inc.

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

3.8. Using a Message Dialog to Display a Message

The programs discussed thus far display output in the Console window. Visual Basic programs often use message dialog windows to display output. Visual Basic provides class MessageBox for creating message dialogs. We use a message dialog in Fig. 3.24 to display the square root of 2. For this program to compile and execute, you must perform several steps discussed later in this section. Be sure to read the entire section as you create this example.

Figure 3.24. Displaying text in a message dialog.
					1
					' Fig. 3.28: SquareRoot.vb
					2
					' Displaying the square root of 2 in a dialog.
					3
					4
					Imports System.Windows.Forms ' Namespace containing class MessageBox
					5
					6
					Module SquareRoot
 7
					8
					Sub Main()
 9
					10
					Dim root ...

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