Tabcontrol Control
The TabControl provides an easy way of organizing a dialog into logical parts that can be accessed through tabs located at the top of the control. A TabControl contains TabPages that essentially work in a similar way to a GroupBox control, though it is somewhat more complex:
TabControl Properties
Name | Availability | Description |
Alignment | Read/Write | Controls where on the tab control the tabs are displayed. The default is at the top. |
Appearance | Read/Write | Controls how the tabs are displayed. The tabs can be displayed as normal buttons or with flat style. |
HotTrack | Read/Write | If this property is set to true the appearance of the tabs on the control change as, the mouse pointer passes over them. |
Multiline | Read/Write | If this property is set to true, it is possible to have several rows of tabs. |
RowCount | Read/Write | Returns the number of rows of tabs that is currently displayed. |
SelectedIndex | Read/Write | Returns or sets the index of the selected tab. |
TabCount | Read/Write | Returns the total number of tabs. |
TabPages | Read/Write | This is the collection of TabPages in the control. Use this collection to add and remove TabPages. |
Working with TabControl
Drag and drop a TabControl and add pages as show in below picture.
Now change the text property of the TabControl tab page as shown in below picture.
Design according to your choice or shown in below image.
Code for picking date
for this add a month calendar and make visibility false and true its visibility on PickDate button click.
Private Sub Button1_Click_1(ByVal sender As System.Object,
ByVal e As System.EventArgs) Handles Button1.Click
monthCalendar1.Visible = True
End Sub
Private Sub MonthCalendar1_DateChanged(ByVal sender As System.Object,
ByVal e As System.Windows.Forms.DateRangeEventArgs) Handles MonthCalendar1.DateChanged
textBox3.Text = DateTime.Now.ToLongDateString()
MonthCalendar1.Visible = False
End Sub
On clicking next button you can move on next TabIndex code for this is given below-
Private Sub LinkLabel1_LinkClicked(ByVal sender As System.Object,
ByVal e As System.Windows.Forms.LinkLabelLinkClickedEventArgs) Handles LinkLabel1.LinkClicked
If textBox1.Text = "" OrElse textBox2.Text = "" OrElse textBox3.Text = "" Then
MessageBox.Show("Please fill your personal information")
Else
Me.tabControl1.SelectedIndex = 1
End If
End Sub
Code for previous button Click
Private Sub LinkLabel3_LinkClicked(ByVal sender As System.Object,
ByVal e As System.Windows.Forms.LinkLabelLinkClickedEventArgs)
Handles LinkLabel3.LinkClicked
Me.tabControl1.SelectedIndex = 0
End Sub