Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Simple: Object setfocus in a form
Message
From
31/03/1999 00:45:49
 
 
To
31/03/1999 00:40:20
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00203750
Message ID:
00203753
Views:
18
Gan,

The first thing that happens is Form.Load(), followed by Form.Init() (not taking into account the DataEnvironment). At the time of Load, all objects that were created visually in your Form Designer does not yet exist. Between Form.Load() and Form.Init(), the Inits of the objects contained in the form takes place, e.g. cmdButton.Init(), TextBox1.Init(). If any of these fail to INITialize, the form fails to load.

This implies that you cannot put a SetFocus in Form.Load().

Consider setting the TabOrder of the cmdButton to 1. When the form starts, you have the commandbuytton as the first focus.


Kenneth.

>I've created a form with a few buttons and a textbox. When I run the form, I want the Command Button that I want to be SETFOCUS. I have gone through the Help and out some code such as cmdOK.setfocus() in the Load Procedure of the form. However, the error said that Object Not found. I was wondering how I should put it correctly since I already have an object cmdOK in my form.
>
>Thanks.
>
>C.D.Gan
>
>Newbies is like that..
Kenneth.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform