Information générale
Catégorie:
Gestionnaire d'écran & Écrans
Having a bit of a tinker with the builder mechanism using the aselobj() function to populate an array from the form designer. I have missed out the builder parameters and the splitting of the control source etc. but this may do the trick.
LPARAMETER ...
LOCAL lnCount
LOCAL lnLength
LOCAL lnFieldWidth
*!* Create array of control names.
lnObjCount = aselobj(laSelected)
*!* A zero count indicates no objects selected.
if lnObjects > 0
for lnCount = 1 TO lnObjects
if laSelected[lnCount].BaseClass $ "textbox"
lcField = FieldFromControlSource()
lcAlias = AliasFromControlSource()
lnLength = fsize(lcField, lcAlias)
*!* Work out the width based on the current font.
lnFieldWidth = txtWidth(replicate("w", lnLength), ;
laSelected[lnCount].FontName, laSelected[lnCount].FontSize) * ;
fontmetric(6, laSelected[lnCount].FontName, laSelected ;
[lnCount].FontSize) + 2
laSelected[lnCount].Width = lnFieldWidth
endif
endfor
endif
Or something along those lines :-)
Précédent
Répondre
Voir le fil de ce thread
Voir le fil de ce thread à partir de ce message seulement
Voir tous les messages de ce thread
Voir tous les messages de ce thread à partir de ce message seulement