>>Hi All,
>>
>>From previous posts on the UT, I've created a container class so that I can have a checkbox centered in a grid colum. It all works well.
>>
>>I've noticed, though, when when a DownArrow is pressed when the checkbox has focus, the resulting action is like a Tab, i.e., focus moves to the the next column to the right in the grid, rather than moving down a row.
>>
>>I believe that this is due to the container, since when I put a regular checkbox in the column instead of the container, the DownArrow works as expected.
>>
>>Any input/help is appreciated.
>>
>>J
>>
>>P.S. The class is just a container with a checkbox, with the following code in the container init:
>>
>>
With this.ChkBox
>> 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
>
>Jill,
>This works for me :
>
>Lparameters nKeyCode, nShiftAltCtrl
>With this.parent.parent.parent
> lnRows = int((.Height - (sysmetric(8)+.HeaderHeight))/.RowHeight)
> If nKeyCode = 24
> Nodefault
> If .RelativeRow = 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
Cetin
I was refered to this thread. I have a checkbox centered by wraping it with a container and I have the same key board action problem as mentioned here. I tried to add code in keypress as you suggested here. However, the keypress does not get fired at all. I added my centered checkbox through addobject method in column's init(). It works fine with mouse but not key board. Any idea what I did wrong? Thanks.