473,401 Members | 2,139 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,401 software developers and data experts.

Tabbing in tab control

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
Nov 21 '05 #1
4 1306
"Nathan M" <Na*****@discussions.microsoft.com> schrieb:
I'm having trouble disenabling the use of Ctrl+Tab to switch tabs in a tab
control.


I am curious why you would want to disable the standard behavior.

--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://classicvb.org/petition/>

Nov 21 '05 #2
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

Nov 21 '05 #3
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


Nov 21 '05 #4
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


Nov 21 '05 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: Richard | last post by:
Tabbing from the first control on a form always sends me to IE's Address Bar instead of the next control, no matter how I set the TabIndex property for the controls. Why is this happening? For...
0
by: Chris | last post by:
I am using the ASP.NET v1.1 Calendar Control. I do not want the tabbing to stop on the control at all. I set the tabindex property to 0 and it still goes to every day on the control as I tab...
0
by: Mike Walters | last post by:
We are auto tabbing from one control to the next after max length is reached, but when within a groupbox tabbing remains within itself. when we are at the max length and use the backspace or Del...
0
by: Nick | last post by:
Hi, This is a very common issue. I have a read only Windows Application datagrid, on which i want to prevent the tabbing between the columns and rows. What needs to happen is this: When i...
0
by: Nick | last post by:
Hi, I have a requirement to build a mouse free windows application and have to hence rely heavily on the tabbing indices. However, I'm facing some issues when the tab goes to a datagrid. It...
2
by: rmiller | last post by:
I'm in dire straits. I'm converting part of a product into VB.NET, but still need to access forms written in VB 6.0. I've got just about everyting working, but the tabbing on the form. The form...
0
by: sklett | last post by:
I've got a odd thing happening when tabbing through my form. everything is fine as long as I only tab through the fields, but if I skip 10 fields and click in a field, enter data then hit tab it...
6
by: Doug Bell | last post by:
Hi I have a DataGrid with some hidden columns and also some read Only and some ComboBox Columns. Sandard Tabbing through the Datagrid sees the focus go to the hidden columns requiring further...
3
by: Ty | last post by:
I am creating a ASP.net project and I wanted to make it so that when the user tabs on on of my pages that they do not have to tab through some controls. Is there a way to skip controls while...
4
by: Joe90 | last post by:
Hi, I'm looking for some help on auto tabbing between edit boxes, on a asp.net page writing with C#. The edit boxes are auto generated at run time and could from 1 to many boxes so the code...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.