>>I wish this:
>>
>>Allow to set a Column's control for the active row,
>>with a new SparseControl ( or ActiveControl or FocusControl, or use Sparse ... ) text property,
>>and others controls into the not active row ( with DynamicCurrentControl )
>>>>like a native VFP's feature.
>>
>>This boost the VFP's grid a lot.
>
>Hi
>I've done something like this using invisible controls on form and a textbox class that activates it when user starts typing. Control that will be activated is set in a textbox property.
>
>LPARAMETERS nKeyCode, nShiftAltCtrl
>
>IF nKeyCode = 13 OR ( ( ISALPHA(CHR(nKeyCode)) OR CHR(nKeyCode)$'01234567890') AND nShiftAltCtrl = 0)
> NODEFAULT
> WITH this.Parent.Parent
> lnTop = OBJTOCLIENT(this.Parent.Parent,1) ;
> + .HeaderHeight + 1 + (.RowHeight *(.RelativeRow - 1 ))
> lnLeft = OBJTOCLIENT(this.Parent,2)
> lnWidth = this.parent.Width
> lnHeight = .RowHeight - 1
> ENDWITH
>
>
> WITH GETPEM(thisform, 'this.cInPlaceControl')
> .zorder(0)
> .Left = lnLeft
> .Top = lnTop
> .Width = lnWidth
> .Height = lnHeight
> .Enabled = .t.
> .Visible = .t.
> KEYBOARD CHR(nKeyCode)
> .SetFocus()
> ENDWITH
>ENDIF
>
>
>Works very well and seems that the control is "inside" grid.
Dorin,
A little remark: You have to test for (nKeyCode >= 0) or better (between(nKeyCode, 0, 255).
Function keys return a negative value. The chr() does not accept negative values
Gregory