Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Set focus on first contrl
Message
De
25/07/1999 19:56:13
 
 
À
Tous
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Titre:
Set focus on first contrl
Divers
Thread ID:
00245917
Message ID:
00245917
Vues:
53
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.

In my case (after instantiate the form class)
the first control is a textbox readonly=.f., tabindex=1,
the second control is a textbox readonly= .t., tabindex=2,
the third control is a combobox readonly=.t., tabindex=3

FOR EACH oCont IN Thisform.Controls
IF oCont.Baseclass = 'Pageframe'
FOR EACH Ctrl IN oCont.Page1.Controls
IF PEMSTATUS(Ctrl,'TabIndex',5) = .T. AND ;
PEMSTATUS(Ctrl,'Readonly',5) = .T. AND ;
Ctrl.Readonly = .F.
Ctrl.SetFocus()
EXIT
ENDIF
ENDFOR
EXIT
ENDIF
ENDFOR

What is happening is that instead the focus goes to the second control (tabindex=2) is going to third (tabindex=3). What is wrong?
Antonio Carlos Kleinübing
Systems Analyst
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform