Is there any method to temporarily disable focus changing?(I assume only
method is tab or mouse?) This problem has been tieing me up for a while and
nothing seems to work. The only thing that I *know* will work is to disable
all tab stops on all controls. This brute force method doesn't seem like a
good idea though.
What I wanted to do was take control the control enter/leave and mouse
enter/leave and "switch back" the focus when it is changed. I would do this
by keeping track of the last control that had focus before it was changed.
The problem here though is that because of the way the events are fired I
cannot do it properly it seems the entered routine is called before the
leave of the last control and hence I would overwrite the state. I thought
about keeping a "2-deep" state and I would ignore the first because it would
always be pointing to the current control. The problem here is that this
seems like a hack and I'm not sure it will work in all cases ;/
Any ideas?
Essentially what I want is for any control with the mouse entered to take
control of the focus and not release it until that control does not have the
mouse on it. When the mouse leaves that control then the focus will go back
to the original control before the new control was entered. The problem I
have with my code now is that the user can hit the tab button and change
focus while the mouse is over a control which screws everything up. I also
need this to work with pre-existing net controls so I have to override the
events to handle it instead of creating a custom control.
Thanks,
Jon