CAMSYSTEMS
asked on
C# Tabbing Between User Controls
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?
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?
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.
ASKER
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
P.S on the User Control there are other buttons that are not visible. However these buttons have tabstop set to false
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.
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.
"the User Control there are other buttons that are not visible. However these buttons have tabstop set to false"
Definetly worth looking at it...
Definetly worth looking at it...
ASKER
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)
{
}
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)
{
}
ASKER
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
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
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.