Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Aligning checkbox in grid
Message
 
To
28/09/2000 15:08:44
General information
Forum:
Visual FoxPro
Category:
Forms & Form designer
Miscellaneous
Thread ID:
00422219
Message ID:
00422274
Views:
13
>>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
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform