On the click of button back color of form will be changed in VB.NET(Three Button Red, green and blue,on the click of red button back color of form will be changed to red and so on.)
PROPERTIES:
CODEING:
Button1,Button2,Button3 | |
Text(Button1) | RED |
ForeColor(Button1) | red |
Text(Button2) | GREEN |
ForeColor(Button2) | green |
Text(Button3) | BLUE |
ForeColor(Button3) | blue |
FlatStyle | Flat |
Public Class Form1
Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
Me.BackColor = Color.Red
Button1.BackColor = Color.DarkRed
End Sub
Private Sub Button2_Click(sender As Object, e As EventArgs) Handles Button2.Click
Me.BackColor = Color.Green
Button2.BackColor = Color.LimeGreen
End Sub
Private Sub Button3_Click(sender As Object, e As EventArgs) Handles Button3.Click
Me.BackColor = Color.Blue
Button3.BackColor = Color.Navy
End Sub
End Class
DESIGNING:Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
Me.BackColor = Color.Red
Button1.BackColor = Color.DarkRed
End Sub
Private Sub Button2_Click(sender As Object, e As EventArgs) Handles Button2.Click
Me.BackColor = Color.Green
Button2.BackColor = Color.LimeGreen
End Sub
Private Sub Button3_Click(sender As Object, e As EventArgs) Handles Button3.Click
Me.BackColor = Color.Blue
Button3.BackColor = Color.Navy
End Sub
End Class
Comments
Post a Comment