Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How to set the hot key in Tabcontrol?
Message
From
12/01/2011 12:55:07
 
 
To
12/01/2011 10:45:26
General information
Forum:
ASP.NET
Category:
Coding, syntax and commands
Environment versions
Environment:
VB 9.0
OS:
Windows XP
Miscellaneous
Thread ID:
01495911
Message ID:
01495924
Views:
29
>HI, ALL
> My question is how to set the hot key in Tabcontrol, for example like button , i will go to property set the text = &Enquire,
>then i key alt + E will onclick the button ..... but i want to Tabcontrol make a hot key, alt + X will go to tabpage1, alt + Y go to
>tabpage2 , how can i do?

The control has no inbuilt hotkey functionality but there are several options. Simplest may be something like:
   Private Sub TabControl1_PreviewKeyDown(ByVal sender As System.Object, ByVal e As System.Windows.Forms.PreviewKeyDownEventArgs) Handles TabControl1.PreviewKeyDown

        If (e.KeyData And Keys.Alt) = Keys.Alt Then
            If (e.KeyData And Keys.X) = Keys.X Then
                TabControl1.SelectedTab = TabPage1
            End If
            If (e.KeyData And Keys.Y) = Keys.Y Then
                TabControl1.SelectedTab = TabPage2
            End If
            'etc
        End If
    End Sub
but, of course there's not direct link with the Tabpage header :-{
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform