VB.NET Technology

VB.Net Projects

VB.Net Project 1

Tabcontrol Control
Previous Home Next
adplus-dvertising

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

NameAvailabilityDescription
AlignmentRead/WriteControls where on the tab control the tabs are displayed. The default is at the top.
AppearanceRead/Write Controls how the tabs are displayed. The tabs can be displayed as normal buttons or with flat style.
HotTrackRead/WriteIf this property is set to true the appearance of the tabs on the control change as, the mouse pointer passes over them.
MultilineRead/Write If this property is set to true, it is possible to have several rows of tabs.
RowCountRead/Write Returns the number of rows of tabs that is currently displayed.
SelectedIndexRead/WriteReturns or sets the index of the selected tab.
TabCountRead/Write Returns the total number of tabs.
TabPagesRead/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
Previous Home Next