Navigation Sample Program in Visual Basic.Net
Use Controls
Panels Control
Tab Page Control
Button Control
Timer Control1.From ൽ രണ്ട് Panel control drag ചെയ്യുക.
2. Panel1 ൻറെ properties ൽ Dock = Left തെരെഞ്ഞടുക്കുക
3.Panel2 ൻറെ properties ൽ Dock = Fill തെരെഞ്ഞടുക്കുക.
3. Panel1 ൻറെ ഉള്ളിൽ വീണ്ടും ഒരു panel drag ചെയ്ത് അതിന്റെ or panel3
properties ൽ Dock = Top തെരെഞ്ഞടുക്കുക.
4.Panel2 ൻറെ ഉള്ളിൽ വേറെ ഒരു panel drag ചെയ്ത് അതിന്റെ or panel 4
properties ൽ Dock =Top തെരെഞ്ഞടുക്കുക.
5. Panal 3 ൽ ചെറിയ ഒരു button വരച്ചു അതിന്റെ properties ൽ backgroundstyle =fill select ചെയ്യുക.
6.ഒരു Tab page control panel 2 ൽ drag ചെയ്ത് additional ആയി രണ്ട് page add ചെയ്യുക. (Tap page control ൻറെ right top ൽ or button ക്ലിക്ക് ചെയ്താൽ add and remove page കാണാം അതിൽ add ക്ലിക്ക് ചെയ്ത് പുതിയത് ഉണ്ടാകാം )
7. Panel1ൽ ചിത്രത്തിൽ കാണുന്ന പോലെ button ക്രമീകരിക്കുക.
Front End Example Navigation Button
മുകളിൽ കാണുന്ന v shape ൽ ക്ലിക്ക് ചെയ്താൽ ഇതുപോലെ കാണാം 👇
ഓരോ button ക്ലിക്ക് ചെയ്താൽ button and Tabpage background color same ആകുന്നത് കാണാം 👇
Complete Source code:
Public Class Form1
Dim slidemenu As String = "close"
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Timer1.Start()
End Sub
Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tick
If slidemenu = "open" Then
spa.Width += 25
If spa.Width >= 250 Then
Timer1.Stop()
slidemenu = "close"
End If
Else
spa.Width -= 25
If spa.Width <= 50 Then
Timer1.Stop()
slidemenu = "open"
End If
End If
End Sub
Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
TabControl1.SelectedTab = TabPage1
TabPage1.BackColor = Color.Aquamarine
Button2.BackColor = Color.Aquamarine
Button3.BackColor = Color.Transparent
Button4.BackColor = Color.Transparent
Button5.BackColor = Color.Transparent
End Sub
Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.Click
TabControl1.SelectedTab = TabPage2
TabPage2.BackColor = Color.Chocolate
Button3.BackColor = Color.Chocolate
Button2.BackColor = Color.Transparent
Button4.BackColor = Color.Transparent
Button5.BackColor = Color.Transparent
End Sub
Private Sub Button4_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button4.Click
TabControl1.SelectedTab = TabPage3
TabPage3.BackColor = Color.DarkGray
Button2.BackColor = Color.Transparent
Button3.BackColor = Color.Transparent
Button4.BackColor = Color.DarkGray
Button5.BackColor = Color.Transparent
End Sub
Private Sub Button5_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button5.Click
TabControl1.SelectedTab = TabPage4
Button2.BackColor = Color.Transparent
Button3.BackColor = Color.Transparent
Button4.BackColor = Color.Transparent
Button5.BackColor = Color.WhiteSmoke
End Sub
End Class
Dim slidemenu As String = "close"
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Timer1.Start()
End Sub
Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tick
If slidemenu = "open" Then
spa.Width += 25
If spa.Width >= 250 Then
Timer1.Stop()
slidemenu = "close"
End If
Else
spa.Width -= 25
If spa.Width <= 50 Then
Timer1.Stop()
slidemenu = "open"
End If
End If
End Sub
Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
TabControl1.SelectedTab = TabPage1
TabPage1.BackColor = Color.Aquamarine
Button2.BackColor = Color.Aquamarine
Button3.BackColor = Color.Transparent
Button4.BackColor = Color.Transparent
Button5.BackColor = Color.Transparent
End Sub
Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.Click
TabControl1.SelectedTab = TabPage2
TabPage2.BackColor = Color.Chocolate
Button3.BackColor = Color.Chocolate
Button2.BackColor = Color.Transparent
Button4.BackColor = Color.Transparent
Button5.BackColor = Color.Transparent
End Sub
Private Sub Button4_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button4.Click
TabControl1.SelectedTab = TabPage3
TabPage3.BackColor = Color.DarkGray
Button2.BackColor = Color.Transparent
Button3.BackColor = Color.Transparent
Button4.BackColor = Color.DarkGray
Button5.BackColor = Color.Transparent
End Sub
Private Sub Button5_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button5.Click
TabControl1.SelectedTab = TabPage4
Button2.BackColor = Color.Transparent
Button3.BackColor = Color.Transparent
Button4.BackColor = Color.Transparent
Button5.BackColor = Color.WhiteSmoke
End Sub
End Class
No comments:
Post a Comment