Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Automatically size column widths in a grid
Message
De
11/09/2003 20:23:50
 
 
À
08/09/2003 07:15:49
Information générale
Forum:
Visual FoxPro
Catégorie:
Classes - VCX
Divers
Thread ID:
00826986
Message ID:
00828373
Vues:
14
Hi Marcia,

Thanks so much for the info! That did the trick!

Regards
Dennis

>Hello Dennis.
>
>Is there a way to automatically size column widths in a grid (probably in the Init event?)
>
>As the others have said, this is native in VFP 8. If you are using an earlier version, this code should help get you started.
>
>
>LOCAL lcFontStyle
>
>lcFontStyle = ''
>FOR EACH loColumn IN THis.Columns
>  *** Get the font style
>  WITH loColumn
>    lcFontStyle = lcFontStyle + IIF( .FontBold, 'B', '' )
>    lcFontStyle = lcFontStyle + IIF( .FontItalic, 'I', '' )
>    lcFontStyle = lcFontStyle + IIF( .FontOutline, 'O', '' )
>    lcFontStyle = lcFontStyle + IIF( .FontShadow, 'S', '' )
>    lcFontStyle = lcFontStyle + IIF( .FontUnderline, 'U', '' )
>
>    *** Set the width according to the underlying data
>    .Width = LEN( EVALUATE( .ControlSOurce ) ) * FONTMETRIC( 6, .FontName, .FontSize, lcFontStyle )
>  ENDWITH
>ENDFOR
>
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform