Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Center Checkbox in a grid
Message
De
28/12/2001 17:24:23
 
 
À
28/12/2001 12:32:40
Cetin Basoz
Engineerica Inc.
Izmir, Turquie
Information générale
Forum:
Visual FoxPro
Catégorie:
FoxWeb
Divers
Thread ID:
00598708
Message ID:
00599016
Vues:
20
Thanks Cetin !
I finally got it working correctly.
Greg

>>Cetin,
>>Thanks for your help but I'm still doing something wrong....Below is the class code I created from your suggestion. When the program runs an error occurs saying "check1 not found". The check boxes show up but are not centered becasue of the error in the with/endwith statement.
>>
>>DEFINE CLASS grdchkbox AS checkbox && Would be a container
>> Height = 13
>> Width = 12
>> Caption = ""
>> Name = "grdchkbox"
>>
>> *-- Occurs when an object is resized.
>> PROCEDURE resize
>> WITH this.check1
>> .left=(this.Parent.Width-.width)/2
>> ENDWITH
>>
>> ENDPROC
>>
>>
>> PROCEDURE Init
>> WITH this
>> .resize()
>> .check1.controlsource=.parent.controlsource
>> ENDWITH
>> ENDPROC
>>
>>
>> PROCEDURE KeyPress
>> LPARAMETERS nKeyCode, nShiftAltCtrl
>> WITH this.Parent.Parent.Parent
>> lnrows=INT((.height-(SYSMETRIC(8)+.headerheight))/.rowheight)
>> IF nKeyCode=24
>> NODEFAULT
>> IF .relativeview=lnrows
>> .doscroll(1)
>> ENDIF
>> .activatecell(.relativerow+1,.relativecolumn)
>> ENDIF
>> IF nKeyCode=5
>> NODEFAULT
>> IF .relativerow=1
>> .doscroll(0)
>> ENDIF
>> .activatecell(.relativerow-1,.relativecolumn)
>> ENDIF
>> ENDWITH
>>
>>
>> ENDPROC
>>
>>
>>ENDDEFINE
>>
>>Any further thoughts on what I'm missing?
>>Greg
>
>Greg,
>It'd be container as bolded in your reply.
>
>DEFINE CLASS grdchkbox AS CONTAINER
>   BorderWidth = 0
>   BackStyle = 0
>	Height = 19
>	Width = 17
>	Name = "grdchkbox"
>
>ADD OBJECT check1 as CheckBox with Caption='', Height=17, Width=17
>
>*-- Occurs when an object is resized.
>PROCEDURE resize
>  WITH this.check1
>     .left=(this.Parent.Width-.width)/2
>  ENDWITH
>ENDPROC
>
>PROCEDURE Init
>WITH this
>   .resize()
>   .check1.controlsource=.parent.controlsource
>ENDWITH
>ENDPROC
>
>
>PROCEDURE CHECK1.KeyPress
>* Previous checkbox keypress code
>ENDPROC
>ENDDEFINE
>
Cetin
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform