tabbing not cyclic - focus disappearing completely !

O

Oli

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.
 
V

VJ

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top