Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Aligning checkbox in grid
Message
 
À
28/09/2000 15:08:44
Information générale
Forum:
Visual FoxPro
Catégorie:
Gestionnaire d'écran & Écrans
Divers
Thread ID:
00422219
Message ID:
00422274
Vues:
11
>>I have a column in a grid which contains checkboxes. The sparse property is set to .f. so the user can see the whole column of checkboxes. I would like the checkboxes to be in the center of the column instead of on the left. I tried using the alignment property of the column but it didn't seem to do the trick (in fact it gave me an error). Is there a way to do this?
>
>You have to create a container class with a checkbox inside it.
>Add that container to the column.
>
>Set the Checkbox.Caption = "" and it's AutoSize = .T.
>Set the Container.BorderWidth = 0
>Set both BackStyle = 0 (or not - it usually looks better though)
>
>In the container class Init():
>
>
With this.Check1
>  If Type("this.parent.ControlSource")#"U"
>    .ControlSource = this.parent.ControlSource
>  EndIf
>  .Left = this.parent.Width/2 - .Width/2
>  If this.Height > .Height
>    .Top = this.parent.Height/2 - .Height/2
>  EndIf
>EndWith
Thanks for the tip and the code. Works like a charm.
Rip Ryness
International Falls, MN
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform