Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Reversing text in editbox in a grid
Message
From
01/08/2006 04:07:06
 
 
To
01/08/2006 03:11:45
Dorin Vasilescu
ALL Trans Romania
Arad, Romania
General information
Forum:
Visual FoxPro
Category:
Classes - VCX
Environment versions
Visual FoxPro:
VFP 9 SP1
OS:
Windows XP SP1
Database:
Visual FoxPro
Miscellaneous
Thread ID:
01141577
Message ID:
01142041
Views:
13
>>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
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform