Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
VFP5 and _CUROBJ
Message
From
25/11/1998 23:45:16
 
 
General information
Forum:
Visual FoxPro
Category:
Forms & Form designer
Miscellaneous
Thread ID:
00161344
Message ID:
00161702
Views:
37
>>I know aboutthe SETFOCUS Method. As mentioned above, I do not know WHAT "Control" is.
>>
>>In the FPW2.6 code I did not care as I used _CUROBJ = OBJNUM(currentfield)+1
>>This set the focus to the NEXT tab order field without the need of knowing what its name or variable was.
>>
>>THIS IS WHAT I NEED TO DO!!
>>
>>Bernard
>
>You can return a numeric value from the VALID event of a control to specify which control gets the focus. Quoting from the VFP5 help file:
>· If a positive value is returned, the value specifies the number of controls the focus advances. For example, if the Valid event returns 1, the next control gets the focus.
>· If a negative value is returned, the value specifies the number of controls the focus moves back. For example, if the Valid event returns –1, the previous control gets the focus.
>
>HTH,
>Rick


Rick
I tried this in a form with 2 text boxes and a command button. It works as it should?? If I tab from field to field the valid is called and the control works as in the help. But if i call the VALID of the field from a form method (which I need to do), nothing happens.

I added code in the click of the button
Thisform.text1.setfocus $$focus was still on the command button
*now text1 is gotfocus()
Thisform.text1.Valid && valid has one line - return 2.

This should put the focus onto the next field+1 which is the command button - but it does not.Text1 still has the focus.

Any other ideas or did I do something wrong??

Bernard
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform