We have used command buttons to execute (run) code. We made buttons turn colour, hide and show and shrink and grow. This is obviously limited, we are now going to look at how to output text onto screen using a MESSAGE BOX.
Class Exercise - Task 2
Create a new Visual Basic application that has one button on a form. The button's caption should be 'Show Message Box'. When clicked a MsgBox should appear saying ‘Hello’.
Hint
Add the following code to the click event of the button.
Private Sub cmdShowMsgBox_Click
MsgBox("Hello")
End Sub
Add two more buttons to display your address and post code.
Change the back colour and fore colour of the buttons.
Change the back colour and fore colour of the form
Experiment with MessageBoxes and see what else can be displayed