Add a Label to the form. Change the Name of the label to lblMessage. Change the AutoSize Property to False. Resize the label so that it is as wide as your form and a couple of lines deep. Change the Text Property so that the label shows nothing.
Step 2: Write the code that will make the different things happen when different events happen while the program is running. (Run-Time)
Write the code for the click event on the btnLeftAlign button. Insert the lines of code shown below. These are the statements that will be executed when the program is running and the btnLeftAlign button is clicked.
Private Sub btnLeft_Click(ByVal … ) Handles btnLeft.Click
When the program executes the first thing it does is load the form and all of its objects into memory. Often we want to program things that happen at this point – initial instructions that only happen at the beginning of the program. To do this, we can put statements in the Form_Load Event procedure.
In the alignment program, we could program the caption of the label to initially say “Watch My Alignment Change!”. We can set properties in the Form_Load Event procedure as follows:
Private Sub frmAlignment_Load(ByVal …) Handles MyBase.Load