Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Grid Column Resize
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Divers
Thread ID:
00026984
Message ID:
00027110
Vues:
35
>>Does anyone know an easy way to dynamically resize a grid column (textbox) based on the size of the source field? (something like AutoSize would be perfect)
>>
>>I'm adding a variable number of columns to grid and they may be selected by user from a large assortment of fields. Everything works pretty well except that column widths come out looking odd (wide column for 1 char, narrow column for 50 chars, etc.)...is there an easier way than measuring fields and calculating widths?
>
>I do it by filling an array from AFIELDS which will return the field width in column 3. You can take that and multiply it by some # returned from txtwidth() or fontmetric(6) to determine the width for the column.
>
>Steve Despres
>EZ Data Inc
>sdespres@erols.com

If your clients are only using a few fields, it may be easier just to loop through the columns using len() for each field (times the above-mentioned txtwidth/fontmetric fudge factor, of course).

Barbara
Barbara Paltiel, Paltiel Inc.
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform