K
kea
I have a checkbox and a textbox in a continuous taborder on a form
along with a bunch of other controls. The textbox is disabled.
When I leave the checkbox I want to enable the textbox and move the
focus to it (only if the checkbox.checked=true).
So on the checkbox Leave-event i do the following:
if checkbox.checked=true then
textbox.enabled = true
end if
The result:
the textbox is enabled but the focus is moved to the control after the
textbox.
Question:
Why does the focus not go to the textbox as the textbox is enabled? How
do I get the wanted effect?
I know I can use textbox.focus(), but that gives me problems if the
checkbox is checked and another control subsequent is activated by a
mouseclick. Then the focus will go to the textbox instead of the
control activated by the mouse.
along with a bunch of other controls. The textbox is disabled.
When I leave the checkbox I want to enable the textbox and move the
focus to it (only if the checkbox.checked=true).
So on the checkbox Leave-event i do the following:
if checkbox.checked=true then
textbox.enabled = true
end if
The result:
the textbox is enabled but the focus is moved to the control after the
textbox.
Question:
Why does the focus not go to the textbox as the textbox is enabled? How
do I get the wanted effect?
I know I can use textbox.focus(), but that gives me problems if the
checkbox is checked and another control subsequent is activated by a
mouseclick. Then the focus will go to the textbox instead of the
control activated by the mouse.