>>>Hi all,
>>>
>>> I have a form with several controls. I'd like to move trough controls only by pressing Tab key, Ctrl+Tab or by mouse clicking.
>>> Would you please tell me how can I do this.
>>>
>>>Thanks
>>>
>>>Stoyka
>>Stokya,
>>
>>This is how things work without doing anything, what are you seeing that is different?
>
> I have a text box txtNameE on a form
> when txtNameE is the active control and txtNameE.value = "" I've pressed BackSpace key then the previous control got the focus.
>
>Stoyka
Set form.keypreview to .T.
in the form keypress event, watch for the keys you want to ignore: something like
do case
case nkeycode = 127 and this.activecontrol.value = space(0) &&backspace
nodefault
case nkeycode = 19 and this.activecontrol.value = space(0) &&leftarrow
nodefault
case nkeycode = 4 and this.activecontrol.value = space(0) &&rightarrow
nodefault
case inlist(nkeycode, 5,4) &&up and down arrows
nodefault
end case
This is an awkward solution, but yours is an awkward problem. Hope this gives you some ideas.
Erik Moore
Clientelligence