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