C# Tabbing Between User Controls

Posted on 2007-03-20
Last Modified: 2008-01-09
I have created a User Control with a label on it and a button next to the label.

I have then added the control to a form 4 times, one below the other and set the tab order up correctly.

When I load the form the focus is on the first User Control, however when I tab to go the the next control, nothing happens, any ideas?
Question by:CAMSYSTEMS

Expert Comment

ID: 18755774
Make sure that the TabStop of the usercontrol is set to true and the TabIndex is set to the ordinal you expect to follow during the tabbing.

Author Comment

ID: 18755912
Yes they are definately setup correctly. Any other ideas?

P.S on the User Control there are other buttons that are not visible. However these buttons have tabstop set to false
LVL 13

Expert Comment

ID: 18755939

Check the CanFocus property is set to true.

Also, you may want to transfer the focus to the button inside your user control. So you have to handle the user control's Focused event.
DevOps Toolchain Recommendations

Read this Gartner Research Note and discover how your IT organization can automate and optimize DevOps processes using a toolchain architecture.


Expert Comment

ID: 18755949
"the User Control there are other buttons that are not visible. However these buttons have tabstop set to false"
Definetly worth looking at it...

Author Comment

ID: 18757253
I have found the reason for it.....

I am using the below override, which I need to use. It catches the Tab key press, however I need it to treat this as it normally would...

Any ideas???

protected override bool ProcessCmdKey(ref Message msg, Keys keyData)


Author Comment

ID: 18757491

If Key = Tab then return false, easy at that, what I nightmare I had!!!!

O well, hopefully it will help someone else in the future

Accepted Solution

Computer101 earned 0 total points
ID: 19090286
PAQed with points refunded (500)

EE Admin

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

We all know that functional code is the leg that any good program stands on when it comes right down to it, however, if your program lacks a good user interface your product may not have the appeal needed to keep your customers happy. This issue can…
Introduction Hi all and welcome to my first article on Experts Exchange. A while ago, someone asked me if i could do some tutorials on object oriented programming. I decided to do them on C#. Now you may ask me, why's that? Well, one of the re…
This Micro Tutorial hows how you can integrate  Mac OSX to a Windows Active Directory Domain. Apple has made it easy to allow users to bind their macs to a windows domain with relative ease. The following video show how to bind OSX Mavericks to …
With the power of JIRA, there's an unlimited number of ways you can customize it, use it and benefit from it. With that in mind, there's bound to be things that I wasn't able to cover in this course. With this summary we'll look at some places to go…

867 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

15 Experts available now in Live!

Get 1:1 Help Now