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.Focuse d)) Then
btnFirst.Enabled = False
End If
End Sub
--------------------------
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.Focuse
btnFirst.Enabled = False
End If
End Sub
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.