Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Set focus on first contrl
Message
De
25/07/1999 21:00:35
 
 
À
25/07/1999 19:56:13
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Divers
Thread ID:
00245917
Message ID:
00245933
Vues:
22
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.
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform