C# Tabbing Between User Controls

Posted on 2007-03-20
Medium Priority
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
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions

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.
How To Reduce Deployment Times With Pre-Baked AMIs

Even if we can't include all the files in the base image, we can sometimes include some of the larger files that we would otherwise have to download, and we can also sometimes remove the most time-consuming steps. This can help a lot with reducing deployment times.


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

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

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

Today I had a very interesting conundrum that had to get solved quickly. Needless to say, it wasn't resolved quickly because when we needed it we were very rushed, but as soon as the conference call was over and I took a step back I saw the correct …
Performance in games development is paramount: every microsecond counts to be able to do everything in less than 33ms (aiming at 16ms). C# foreach statement is one of the worst performance killers, and here I explain why.
This tutorial will teach you the special effect of super speed similar to the fictional character Wally West aka "The Flash" After Shake : http://www.videocopilot.net/presets/after_shake/ All lightning effects with instructions : http://www.mediaf…
In response to a need for security and privacy, and to continue fostering an environment members can turn to for support, solutions, and education, Experts Exchange has created anonymous question capabilities. This new feature is available to our Pr…

718 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