Solved

C# Tabbing Between User Controls

Posted on 2007-03-20
8
1,107 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
How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

 
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

Top 6 Sources for Identifying Threat Actor TTPs

Understanding your enemy is essential. These six sources will help you identify the most popular threat actor tactics, techniques, and procedures (TTPs).

Join & Write a Comment

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…
Exception Handling is in the core of any application that is able to dignify its name. In this article, I'll guide you through the process of writing a DRY (Don't Repeat Yourself) Exception Handling mechanism, using Aspect Oriented Programming.
Excel styles will make formatting consistent and let you apply and change formatting faster. In this tutorial, you'll learn how to use Excel's built-in styles, how to modify styles, and how to create your own. You'll also learn how to use your custo…
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.

746 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

14 Experts available now in Live!

Get 1:1 Help Now