This Visual Basic code defines a form with three buttons. When each button is clicked, it changes the text, autosize property, and text alignment of a label on the form. Button1 sets the label to display "HI!" aligned to the middle left. Button2 sets it to "HELLO!" in the middle center. Button3 changes it to "WHAT'SUP?!" and aligned to the middle right.
This Visual Basic code defines a form with three buttons. When each button is clicked, it changes the text, autosize property, and text alignment of a label on the form. Button1 sets the label to display "HI!" aligned to the middle left. Button2 sets it to "HELLO!" in the middle center. Button3 changes it to "WHAT'SUP?!" and aligned to the middle right.
This Visual Basic code defines a form with three buttons. When each button is clicked, it changes the text, autosize property, and text alignment of a label on the form. Button1 sets the label to display "HI!" aligned to the middle left. Button2 sets it to "HELLO!" in the middle center. Button3 changes it to "WHAT'SUP?!" and aligned to the middle right.
This Visual Basic code defines a form with three buttons. When each button is clicked, it changes the text, autosize property, and text alignment of a label on the form. Button1 sets the label to display "HI!" aligned to the middle left. Button2 sets it to "HELLO!" in the middle center. Button3 changes it to "WHAT'SUP?!" and aligned to the middle right.
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click With Me.Label1 .Text = "HI!" .AutoSize = False .TextAlign = ContentAlignment.MiddleLeft End With End Sub Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click With Me.Label1 .Text = "HELLO!" .AutoSize = False .TextAlign = ContentAlignment.MiddleCenter End With End Sub Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.Click With Me.Label1 .Text = "WHAT'SUP?!" .AutoSize = False .TextAlign = ContentAlignment.MiddleRight End With End Sub End Class