I have quite a complex form - build part in the designer, and part
dynamically.
The tabbing basically works - but when I tab off the last control in
my work area panel the focus disappears. no matter how many times I
subsequently press tab - it never returns......
This is tough to debug - how can now tell where the focus is (as a
first step to stopping it going there) ?
any ideas appreciated....
O.
VJ - 12 Mar 2007 19:49 GMT
I never would recommend writing code in LostFocus, but this just you could
debug. So for the final build set proper Tab Order, and create controls in
the order you want them. Or at run-time please reset TabOrder with code...
Anyways temp fix...
Just in the last control of the Form, in it's LostFoucs please write code to
SetFocus to the control you wish. So if your last control was Textbox1, and
you want to set focus to a comboxbox1.. do the below
private void textbox1_LostFocus(object sender, EventArgs e)
{
comboxbox1.Select();
//you could write more code to get NextControl and like that.. to
debug...
}
VJ
>I have quite a complex form - build part in the designer, and part
> dynamically.
[quoted text clipped - 9 lines]
>
> O.
Bryan Phillips - 13 Mar 2007 01:06 GMT
Have you checked your form's ActiveControl property?
--
Bryan Phillips
MCSD, MCDBA, MCSE
Blog: http://bphillips76.spaces.live.com
> I have quite a complex form - build part in the designer, and part
> dynamically.
[quoted text clipped - 9 lines]
>
> O.