I'm trying to set the SelStart value in the Keypress of an EditBox. The client wants to use Shift+Tab to insert Tabs into the EditBox not the Tab key. I have the following code in the keypress of the EditBox. It works except I can't get the SelStart value to work. It always goes to 0. I've used code similar to this in a button to insert the date/time. What am I missing? VFP 9
Auguy
Northwest Ohio
Code:
LPARAMETERS nKeyCode, nShiftAltCtrl
IF ThisForm.RecordEdit
IF nShiftAltCtrl = 1 AND nKeyCode = 15 && Shift+Tab
NODEFAULT
WITH This
mySelStart = .SelStart
* Insert a Tab
.Value = SubStr(.Value, 1, mySelStart) ;
+ CHR(9) ;
+ SubStr(.Value, mySelStart + 1)
*.Refresh()
.SelStart = mySelStart + 1
Endwith
Return
ENDIF
ENDIF
Auguy
Northwest Ohio