Solved

C# Tabbing Between User Controls

Posted on 2007-03-20
8
1,111 Views
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?
0
Comment
Question by:CAMSYSTEMS
8 Comments
 
LVL 3

Expert Comment

by:Kate12
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.
0
 

Author Comment

by:CAMSYSTEMS
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
0
 
LVL 13

Expert Comment

by:Webstorm
ID: 18755939
Hi CAMSYSTEMS,

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.
0
Master Your Team's Linux and Cloud Stack

Come see why top tech companies like Mailchimp and Media Temple use Linux Academy to build their employee training programs.

 
LVL 3

Expert Comment

by:Kate12
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...
0
 

Author Comment

by:CAMSYSTEMS
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)
{

}
0
 

Author Comment

by:CAMSYSTEMS
ID: 18757491
Sorted.

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
0
 
LVL 1

Accepted Solution

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

Computer101
EE Admin
0

Featured Post

Master Your Team's Linux and Cloud Stack!

The average business loses $13.5M per year to ineffective training (per 1,000 employees). Keep ahead of the competition and combine in-person quality with online cost and flexibility by training with Linux Academy.

Question has a verified solution.

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

Suggested Solutions

In my previous two articles we discussed Binary Serialization (http://www.experts-exchange.com/A_4362.html) and XML Serialization (http://www.experts-exchange.com/A_4425.html). In this article we will try to know more about SOAP (Simple Object Acces…
Wouldn’t it be nice if you could test whether an element is contained in an array by using a Contains method just like the one available on List objects? Wouldn’t it be good if you could write code like this? (CODE) In .NET 3.5, this is possible…
Two types of users will appreciate AOMEI Backupper Pro: 1 - Those with PCIe drives (and haven't found cloning software that works on them). 2 - Those who want a fast clone of their boot drive (no re-boots needed) and it can clone your drive wh…
Email security requires an ever evolving service that stays up to date with counter-evolving threats. The Email Laundry perform Research and Development to ensure their email security service evolves faster than cyber criminals. We apply our Threat…

777 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