Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Cycling through controls in a form
Message
 
À
07/06/2002 18:46:11
Hilmar Zonneveld
Independent Consultant
Cochabamba, Bolivie
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00666032
Message ID:
00667017
Vues:
27
>Perhaps you don't need all controls on the form, but a group of related controls? An array of controls? See my FAQ #8110, for different ways to do this.
>
>Hilmar.

Thanks for your reply Hilmar. From the previous posts in this thread I came up with a simple solution for my prob.
x =1 
FOR EACH oControl IN Thisform.Controls
    IF UPPER(Thisform.Controls(x).Baseclass)=UPPER("commandbutton")
    	Thisform.cambianombre(x)  &&& just a sample method where you
                                  &&& can do anything you want with the 
                                  &&& control(s) that meet the criteria
    ELSE
    	IF UPPER(Thisform.Controls(x).Baseclass)=UPPER("container")
	   Thisform.llamada(oControl) &&& sample method to do whatever
                                      &&& you want to do with a control
                                      &&& inside a container placed on
                                      &&& the form
    	ENDIF 
    Endif
	x=x+1
NEXT 
I know this method has some flaws, for instance it's not fully recursive and you have to handcode the baseclass of the controls you want to cicle through.
I'm a mixture of Albert Einstein and Arnold Schwarzenegger. The only trouble is that I got Einstein's body and Schwarzenegger's brain
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform