Intercepting tab focus change question

J

James Hancock

Anyone know how to intercept (reliably) the tab focus change for any control
on a container?

Basically what I'm trying to do, is have it so that if the user is on the
last control in the tab order on a tab page in a tab control, it will move
to the next tab, and set the focus to the first control on that new page
instead of what it does right now which is to move out of the tab control to
the next control outside of the tab control.

Any ideas would be apreciated. I tried overriding the wndProc for the tab
control itself and there weren't any events firing on it.

Thanks!
James Hancock
 
T

Tommy Carlier

Anyone know how to intercept (reliably) the tab focus change for any
control
on a container?

Basically what I'm trying to do, is have it so that if the user is on the
last control in the tab order on a tab page in a tab control, it will
move
to the next tab, and set the focus to the first control on that new page
instead of what it does right now which is to move out of the tab
control to
the next control outside of the tab control.

Any ideas would be apreciated. I tried overriding the wndProc for the tab
control itself and there weren't any events firing on it.

Thanks!
James Hancock

Catch the Leave-event of that last control.
 
J

James Hancock

That doesn't work, because if I do that, I can't tell why it's leaving. If
the user clicks into another control somewhere on the form other than the
tab control, or goes back one in the tab order, I can't catch the leave
event and move to the next tab on the tab control, I have to let it happen.

I need to catch the actual tab focus shift from the tab key, but it doesn't
fire a key down on the last control unless it's a text box that has
AcceptsTab = true.

Thanks anyways!
James Hancock
 

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