Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Any Code snipet for setting controlsource prefix?
Message
 
 
À
16/02/2001 15:53:41
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00476810
Message ID:
00476912
Vues:
24
To add what Al told you --
FOR EACH loControl in ThisForm.Controls
   if PEMStatus(loControl, "ControlSource", 5)
      if !empty(loControl.ControlSource)
         loControl.ControlSource = ;
            ThisForm.ControlSourcePrefix + "." + loControl.ControlSource
      endif
   endif
ENDFOR
The form has a Controls collection array that you can loop through. HOWEVER, this will fail for grids. You will need to code for drilling down into container objects like pageframes, containers and grids.

>I have a group of combo controls in a container object that I've saved as a class. The group of controls provide descriptive attributes for each record in my table. Since all the controls have the controlsource (view) in common, I would like to be able to set a single class property I've added called ControlSourcePrefix and have my init code add this suffix to all the controlsouces instead of having to reset each one individually when I add this class to a form with a different controlsource (view).
>Would anyone have a code sample for setting a group of control's controlsource property replaced with the ControlSourcePrefix + controlsouce.
>For example:
> ControlSourcePrefix=v_AccountMaster
>cboCity.controlsource=cityiid -------------> v_AccountMaster.cityiid
>cboDistrict.controlsource=districtiid -----> v_AccountMaster.districtiid
>cboDepartment.controlsouce=departmentii ---> v_AccountMaster.departmentiid
>
>Thank you,
>
>Gary Pike
Mark McCasland
Midlothian, TX USA
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform