Subject: Preventing tab controls from changing page
Posted By: badgolfer Post Date: 12/16/2003 5:19:09 AM

I have a simple tab control with 4 tab pages displayed under it.

I only wish to allow the user to change tab page once they have
filled out certain text boxes on each tab page (a wizard entry
type app).

My question: how can I prevent the user from changing tab page ?
(ie until they have entered the required data on each tab page).

Any help much appreciated.
Reply By: exarkuun Reply Date: 12/16/2003 2:22:35 PM
Hello,

       Just put causevalidation at true for all of page in the tabcontrol. In the event validating of each page put the code who check if all conditions is ok.
Example :
    Private Sub TabPage1_Validating(ByVal sender As Object, ByVal e As System.ComponentModel.CancelEventArgs) Handles TabPage1.Validating
        If text1.text = "" And text2.text = "" Then
            e.Cancel = True
        End If
    End Sub

         i hope that will help you

Exarkuun

Reply By: badgolfer Reply Date: 12/17/2003 4:35:47 AM
That helps me very much. I am very grateful.
Thank you.
Chas.

Go to topic 7629

Return to index page 985
Return to index page 984
Return to index page 983
Return to index page 982
Return to index page 981
Return to index page 980
Return to index page 979
Return to index page 978
Return to index page 977
Return to index page 976