Tab Control problem

secretdesire

New member
Joined
Feb 24, 2008
Messages
1
Programming Experience
Beginner
Hi..
I have a windows application form with a tab control having 3 tab pages on it. each tab page has its own information filling fields and its own save button. I wish that when i click on the save button of first tab page it should pop up a messagebox giving me an option to go to next tab page or save and exit.
If i click yes on this messagebox it should automatically direct me to the next tab page otherwise just save the data and exit......

Any one here can help me out with this???:):):)
 
Hi

try the following code

VB.NET:
Expand Collapse Copy
    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click

        Dim result As New DialogResult

        result = MessageBox.Show("Selection:" & vbCrLf & "Click Yes to go to the next tab" & vbCrLf & "No to exit", "Selection", MessageBoxButtons.YesNo, MessageBoxIcon.Question)

        If result = Windows.Forms.DialogResult.Yes Then
            TabControl1.SelectedIndex() = 1
        Else
            Me.Close()
        End If

    End Sub

the TabControl1.SelectedIndex() = 1 indicates the tabcontrol (They are zero based)

HTH :)
 
Back
Top