Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Is there any way to UnFocus()?
Message
From
08/07/2003 16:04:30
 
 
To
08/07/2003 15:46:03
General information
Forum:
Visual FoxPro
Category:
Other
Miscellaneous
Thread ID:
00808129
Message ID:
00808213
Views:
12
Bill,

Rather than looping through the controls every time, it would be more efficient to do it one time...at init() of the form. You probably can't do it at the init() of the class because all of the other controls (probably) have not fully initialized yet.

Anyway, loop through the controls and store an object reference to the next control in a custom property of the container (I called it nextControl).

Then, to actually setfocus(), all you do is something like the following from inside the container:
this.nextControl.setfocus()
However, since this type of container may only exist once per form, and you know what the next control is at design time, it might be just as easy to manually store the object reference in the form's init(), for example:
thisform.container1.nextControl = thisform.text9
>Hi Pamela,
>That's pretty much how I did it. Just have to check for loControl having a TabIndex (BaseClass custom doesn't have a TabIndex) and Enabled and Visible. Also have to check if This.TabIndex is the last one in This.Parent.Controls so you can set it to the 1st on in Parent.
Steve Gibson
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform