Ronald --
You will also have trouble doing SetFocus in a control's Valid(). Without knowing the specifics of your app's requirements, here are a couple of things you might want to consider:
1. Valid() can return a numeric value (+ or -), as well as .T. or .F. Returning 0 keeps focus on the current control; 1 gives focus to the next control; 2 to the one after that; -1 to the previous control, etc.
2. If you are using the value of a MemVar to determine which control gets focus, you might want to handle this in a form method and not at the control level.
3. Also at the form level, you might try manipulating the value of the control's Enabled property.
HTH -- Bill
>Ok, thanks. I have tried that and I get an error that I can not SetFocus() from with in a when claus. Im testing the value of a variable and if it doesnt match I want it to setFocus to a control elsewhere on the form.
>
>
>>>I know in fpd2.6 to goto a control by program control i would use _curobj = 3 to move to the third field, how do I do this in VFP5, it says to use Object.ActiveControl.Property[ = Value]. But what property and what values do I use to goto the control I need them to. Thanks for any help in the right direction.
>>
>>If you know the control you're going to: Thisform.MyControl.Setfocus() will do it.
>>
>>HTH
>>Barbara
Précédent
Répondre
Voir le fil de ce thread
Voir le fil de ce thread à partir de ce message seulement
Voir tous les messages de ce thread
Voir tous les messages de ce thread à partir de ce message seulement