A
adiel_g
I have a couple of textboxes and a button. I also have other controls
in the same form. When I click on the button, I want to know the
previously selected control, specifically I want to know if it was a
textbox. If I use the .Focused method for example:
If txtBox1.Focused then
.....never goes here
ElseIf txtBox2.Focused then
.....never goes here
End if
It will not work since the button will now have focused:
If btnCheck.Focused then
....it goes into here
End If
The reason being when the user clicked on the button, all the
textboxes lost focus and now the button has focus. Now my question
is, is there a way to programatically know which was the previosly
focused control? I cannot use the click event on the textbox and
store the last clicked textbox since the user might have click on
other controls and therefore that textbox would not be the previously
selected control.
Thanks Before Hand,
Adiel
in the same form. When I click on the button, I want to know the
previously selected control, specifically I want to know if it was a
textbox. If I use the .Focused method for example:
If txtBox1.Focused then
.....never goes here
ElseIf txtBox2.Focused then
.....never goes here
End if
It will not work since the button will now have focused:
If btnCheck.Focused then
....it goes into here
End If
The reason being when the user clicked on the button, all the
textboxes lost focus and now the button has focus. Now my question
is, is there a way to programatically know which was the previosly
focused control? I cannot use the click event on the textbox and
store the last clicked textbox since the user might have click on
other controls and therefore that textbox would not be the previously
selected control.
Thanks Before Hand,
Adiel