Unfortunately, I don't have VS2002 so I can't test it, but I don't see any
reason for it not to work.
Here's a slight mod to the method, but I don't believe it will work any
better:
\\\
Protected Overrides Function ProcessCmdKey(ByRef msg As Message, _
ByVal keyData As Keys) As Boolean
If TypeOf ActiveControl Is TabControl Then
If keyData = (Keys.Control Or Keys.Tab) OrElse _
keyData = (Keys.Control Or Keys.Tab Or Keys.Shift) Then
Return True
End If
End If
Return MyBase.ProcessCmdKey(msg, keyData)
End Function
///
You may like to take a look at the following link though, and use an actual
Wizard Control instead.
http://www.codeproject.com/cs/miscctrl/SampleWizard.asp
--
Mick Doherty
http://dotnetrix.co.uk/nothing.html
"Nathan M" <Na*****@discussions.microsoft.com> wrote in message
news:4F**********************************@microsof t.com...
The reason I want to do this is that I've built a wizard using a tab
control;
I just hide the tabs and place Next/Back buttons on the form.
I tried using the code from your page, Mick, but my tab control still
allows
Ctrl+Tab navigation. I'm using VS 2002 if that makes any difference.
"Mick Doherty" wrote:
http://www.dotnetrix.co.uk/tabcontrols.html --> Prevent users navigating
TabControl via Ctrl+Tab and Ctrl+Shift+Tab.
--
Mick Doherty
http://dotnetrix.co.uk/nothing.html
"Nathan M" <Na*****@discussions.microsoft.com> wrote in message
news:C1**********************************@microsof t.com... > Hi,
>
> I'm having trouble disenabling the use of Ctrl+Tab to switch tabs in a
> tab
> control. I've tried adding the following code in an event handler that
> handles the KeyDown event for the form, the tab control, and each tab
> page:
>
> If e.KeyCode = Keys.Tab Then
> If e.Control Then
> e.Handled = True
> End If
> End If
>
> This doesn't work; I'm still able to use Ctrl+Tab to navigate. Anyone
> have
> the answer?
>
> Thanks,
> Nathan