How To Design a Form With Panels In VB.Net
In This VB.Net Tutorial We Will See How To Design a Form With Panels and Labels Using Visual Basic.Net Programming Language And Visual Studio Editor.
- To Learn More Watch The Video Tutorial Below.
- To Learn More Watch The Video Tutorial Below.
Project Source Code:
Public Class Design_Form_Using_Panels
' create variables to set the panels color
Dim p1Color As Color
Dim p2Color As Color
Dim p3Color As Color
Dim p4Color As Color
Private Sub Design_Form_Using_Panels_Load(sender As Object, e As EventArgs) Handles MyBase.Load
p1Color = Panel1.BackColor
p2Color = Panel2.BackColor
p3Color = Panel3.BackColor
p4Color = Panel4.BackColor
End Sub
Private Sub Label2_MouseEnter(sender As Object, e As EventArgs) Handles Label2.MouseEnter
Panel1.BackColor = Color.White
Label2.ForeColor = p1Color
End Sub
Private Sub Label2_MouseLeave(sender As Object, e As EventArgs) Handles Label2.MouseLeave
Panel1.BackColor = p1Color
Label2.ForeColor = Color.White
End Sub
Private Sub Label1_MouseEnter(sender As Object, e As EventArgs) Handles Label1.MouseEnter
Panel2.BackColor = Color.White
Label1.ForeColor = p2Color
End Sub
Private Sub Label1_MouseLeave(sender As Object, e As EventArgs) Handles Label1.MouseLeave
Panel2.BackColor = p2Color
Label1.ForeColor = Color.White
End Sub
Private Sub Label3_MouseEnter(sender As Object, e As EventArgs) Handles Label3.MouseEnter
Panel3.BackColor = Color.White
Label3.ForeColor = p3Color
End Sub
Private Sub Label3_MouseLeave(sender As Object, e As EventArgs) Handles Label3.MouseLeave
Panel3.BackColor = p3Color
Label3.ForeColor = Color.White
End Sub
Private Sub Label4_MouseEnter(sender As Object, e As EventArgs) Handles Label4.MouseEnter
Panel4.BackColor = Color.White
Label4.ForeColor = p4Color
End Sub
Private Sub Label4_MouseLeave(sender As Object, e As EventArgs) Handles Label4.MouseLeave
Panel4.BackColor = p4Color
Label4.ForeColor = Color.White
End Sub
End Class
///////////////OUTPUT:
Download Projects Source Code