Link to home
Start Free TrialLog in
Avatar of mindserve
mindserve

asked on

Tab control in vb 2005

I have a tab control on a form with 6 tabs. I would like to disable certain buttons on the form that are not on the tab if the focus changes to a different tabpage in the collection. I have tried the code below, but it doesn't work.
----------------------------------------------------------------------------------------------------------------------

Private Sub TabPage2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles TabPage1.Click
        If TabPage2.Focused Then
            btnFirst.Enabled = False
        End If

    End Sub
   
Private Sub TabPage1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles TabPage1.Click
        If CBool(CInt(TabPage1.Focused)) Then
            btnFirst.Enabled = False
        End If

    End Sub
ASKER CERTIFIED SOLUTION
Avatar of Wayne Taylor (webtubbs)
Wayne Taylor (webtubbs)
Flag of Australia image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial