Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Grid Controls
Message
From
27/12/2000 15:07:20
 
 
To
27/12/2000 13:33:24
General information
Forum:
Visual FoxPro
Category:
Forms & Form designer
Title:
Miscellaneous
Thread ID:
00457043
Message ID:
00457135
Views:
24
>Is there anyway to center a checkbox in a cell in a grid?. All I show is the checkbox with no caption.

This is the code for the class I use - put it into a VCX to use it more easily.
**************************************************
*-- Class Library:  custctl.vcx
**************************************************


**************************************************
*-- Class:        colchk (d:\walpole\tools\colchk.vcx)
*-- ParentClass:  container
*-- BaseClass:    container
*-- Time Stamp:   11/24/00 09:54:14 AM
*
DEFINE CLASS colchk AS container


     Width = 100
     Height = 17
     BackStyle = 0
     BorderWidth = 0
     Name = "colchk"


     ADD OBJECT chkColChk AS checkbox WITH ;
          Top = 0, ;
          Left = 0, ;
          Height = 17, ;
          Width = 18, ;
          AutoSize = .T., ;
          BackStyle = 0, ;
          Caption = "", ;
          Name = "chkColChk"


     PROCEDURE centercheckbox
          *----------------------------------------
          *  Author......: Trey Walpole
          *  Date........: September 28, 2000
          *----------------------------------------
          * This method may be called from the
          * parent Column's Resize() event
          * in order to keep the checkbox centered
          * when the Column is resized by the user.
          *----------------------------------------
          With this.chkColChk
               .Left = this.parent.Width/2 - .Width/2
               .Top = this.parent.parent.RowHeight/2 - .Height/2
          EndWith
     ENDPROC


     PROCEDURE Init
          *----------------------------------------
          *  Author......: Trey Walpole
          *  Date........: September 28, 2000
          *----------------------------------------
          If Type("this.parent.ControlSource")#"U"
               If !Type(this.parent.ControlSource)$"NL"
                    *--     don't even allow this guy in here for non logical or numeric fields
                    Return .F.
               EndIf
               this.chkColChk.ControlSource = this.parent.ControlSource
          EndIf
          this.CenterCheckbox()
     ENDPROC


     PROCEDURE Resize
          this.CenterCheckbox()
     ENDPROC


ENDDEFINE
*
*-- EndDefine: colchk
**************************************************
Insanity: Doing the same thing over and over and expecting different results.
Previous
Reply
Map
View

Click here to load this message in the networking platform