Tabcontrol

m_nathani

Member
Joined
Apr 15, 2003
Messages
11
Location
india
Hi Everybody

I have write code to navigate record with Ctrl and arrow key.
i have tabcontrol on forms with three tabpages. when i press ctrl and left or right key my tabpages also change. i dont want to changed tabpage.


Thanks
 
this will stop users being able to use ctrl and an arrow key to scroll through the tabs
Code:
   Private Sub TabControl1_KeyDown(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyEventArgs) Handles TabControl1.KeyDown
        If e.KeyCode = 17 Or e.KeyCode = 37 Or e.KeyCode = 39 Then
            Button1.Focus()
        End If
    End Sub

    Private Sub TabControl1_KeyUp(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyEventArgs) Handles TabControl1.KeyUp
        If e.KeyCode = 17 Or e.KeyCode = 37 Or e.KeyCode = 39 Then
            Button1.Focus()
        End If
    End Sub
note :
i am setting focus to another object ( a button in this case )
hope this helps.
 
Back
Top