IF LOWER(THIS.PARENT.BASECLASS) = "column" .TOP = (THIS.PARENT.PARENT.ROWHEIGHT - .HEIGHT)/2 ENDIFthanks again,
>Define Class grdcheckbox As Container > Width = 14 > Height = 17 > BackStyle = 0 > BorderWidth = 0 > Name = "grdcheckbox" > Add Object check1 As Checkbox With ; > Top = 0, ; > Left = 0, ; > Width = 13, ; > BackStyle = 0, ; > Caption = "", ; > SpecialEffect = 1, ; > Name = "Check1" > > Procedure Init > With This > .Resize() > If Lower(.Parent.BaseClass)='column' > .check1.ControlSource=.Parent.ControlSource > Endif > Endwith > Endproc > > Procedure Resize > With This.check1 > .Left = (This.Parent.Width - .Width)/2 > Endwith > Endproc > > Procedure check1.InteractiveChange > If Lower(This.Parent.Parent.BaseClass)='column' > This.Parent.Parent.Parent.Refresh > Endif > Endproc > > Procedure check1.KeyPress > Lparameters nKeyCode, nShiftAltCtrl > Local lnRows > If nKeyCode=32 > Nodefault > This.Value = !This.Value > This.Refresh > Endif > If Inlist(nKeyCode,4,19,5,56,141,24,50,145,18,57,31,3,51,30) > Nodefault > With This.Parent.Parent.Parent > lnRows = (.Height-(.HeaderHeight+Iif( .ScrollBars % 2 = 1, Sysmetric(8),0)))/.RowHeight > Do Case > Case Inlist(nKeyCode,5,56,141) && Up > If !Bof(.RecordSource) > Skip -1 In (.RecordSource) > Endif > If Bof(.RecordSource) > Go Top In (.RecordSource) > Endif > Case Inlist(nKeyCode,24,50,145) && Down > If !Eof(.RecordSource) > Skip In (.RecordSource) > Endif > If Eof(.RecordSource) > Go Bottom In (.RecordSource) > Endif > Case Inlist(nKeyCode,18,57,31) && PageUp > If !Bof(.RecordSource) > Skip -1*lnRows In (.RecordSource) > Endif > If Bof(.RecordSource) > Go Top In (.RecordSource) > Endif > Case Inlist(nKeyCode,3,51,30) && PageDown > If !Eof(.RecordSource) > Skip lnRows In (.RecordSource) > Endif > If Eof(.RecordSource) > Go Bottom In (.RecordSource) > Endif > Case nKeyCode=4 && RightArrow > Keyboard("{TAB}") > Case nKeyCode=19 && LeftArrow > Keyboard("{BACKTAB}") > Endcase > Endwith > Endif > Endproc >Enddefine >Cetin