Click here to Skip to main content
15,895,829 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I have a usercontrol which is placed inside one panel and some other controls like buttons in another panel. when the usercontrol is active and i move from other controls using tab key, usercontrol gets focus even when the TapStop property for the usercontrol is set to "False".

In another case, when i have the usercontrol placed in the form not inside the panel, usercontrol didnt get focused when moving from other controls using tab key.

Could anyone share me the details why the usercontrol is getting focused when it is only placed inside the panel?

Thanks and Regards,
Amal

What I have tried:

i have set myUserControl.TabStop = false but the control gets focus while moving through tab key, but TabStop is working fine with usercontrol not in panel and also tabstop for button controls in the panels are working fine
Posted
Comments
CHill60 25-May-16 5:41am    
It's probably the Panel the UserControl is in that is getting the focus - try setting TabStop for the panel to false
AmalRaj@Sync 25-May-16 5:43am    
yes, I have already made that too. But still the focus is in userControl
Sergey Alexandrovich Kryukov 25-May-16 11:39am    
Such problems are pretty easy solved, but first things come first:
1) Panel, UserControl? Which ones? Full type names, please (System.Windows.Forms.Panel? anything else?)
2) You can create a full code sample, simplified to focus on only one problem you just need to reproduce. It will make code sample small enough to show here in full. Better write such code sample manually, not using the designer.
—SA

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900