Jump to content
Xtreme .Net Talk

Recommended Posts

Posted

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 don't want to changed tabpage.

 

 

Thanks

  • Leaders
Posted

this will stop users being able to use ctrl and an arrow key to scroll through the tabs

  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.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...