|
-
March 7th, 2003, 01:02 PM
#1
Focus with Panel
I have a user control derived from Panel where we do all of the painting and handling of mouse etc.
What I set the control as a tab stop with a valid tab index, but when I tab with the keyboard through the controls on the form, it never goes to my control.
I know panel is supposed to pass focus to the control it contains, but there are no contain controls, the panel is the control. We used panel bacuase of the boarder styles.
When I put a break point in the initilzation of the conmtrol and call CanFocus the value returned is false. Is there a way to tell the panel, to recieve focus.
Incedently, clicking on the control and calling Focus in the mouse down event works fine.
-
March 7th, 2003, 01:14 PM
#2
Figured it out.
If you set the style using
this.SetStyle(ControlStyles.Selectable, true);
then it works.
-
March 7th, 2003, 01:42 PM
#3
ya, working with mouse events and all GUI stuff - debuging is a pain
so what u do instead is write to a log file and test that way so u have correct event generated and correct log file
paresh
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|