Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Set focus on first contrl
Message
From
25/07/1999 21:00:35
 
 
To
25/07/1999 19:56:13
General information
Forum:
Visual FoxPro
Category:
Other
Miscellaneous
Thread ID:
00245917
Message ID:
00245933
Views:
18
Hi Antonio,

>In following code I need to guarantee the focus goes to the first readable control. I don't know the Tabindex of the first control because depends of the form, and this code is inside class and not always the first control is readable or has the property tabindex.

Try this:
lnLowTab=10000000
oResult=.NULL.
for each oControl in thisform.controls
	if type('oControl.TabIndex')='N';
                and type('oControl.ReadOnly')='L';
                and !oCOntrol.ReadOnly;
                and oCOntrol.TabIndex < lnLowTab
		lnLowTab=oControl.TabIndex
		oResult=oControl
	endif
endfor
if !isnull(oResult)
	oResult.SetFocus()
endif
Some might by disgusted by me setting lnLowTab=1000000, so if it bothers you, just tweak it a little.
Previous
Reply
Map
View

Click here to load this message in the networking platform