>I am writing an 'Edit' button class. When the user presses the button, I need to set the focus to the first object on the form. I don't think I should use a specific name for the first object of all my form. Any way to do it?
>
>
>Tai SC
>
>
>>In VFP, How do I set focus to the first object on the form during runtime if I don't know the name of the first object? I need the cursor to be at the first object when the user presses 'edit' button.
>>
>>Tai SC
You can add a property to your base form class "FIRST_EDIT_CONTROL" which will contain the object name, and in the edit button class add the following:
lcsetfocus = alltrim(thisform.first_edit_control) + '.setfocus()'
&lcsetfocus