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.
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 ...