PRB: SET DATE Resets SelStart Property in Text Boxes (313196)
The information in this article applies to:
- Microsoft Visual FoxPro for Windows 7.0
- Microsoft Visual FoxPro for Windows 3.0
- Microsoft Visual FoxPro for Windows 3.0b
- Microsoft Visual FoxPro for Windows 5.0
- Microsoft Visual FoxPro for Windows 5.0a
- Microsoft Visual FoxPro for Windows 6.0
This article was previously published under Q313196 SYMPTOMS
If you change the value of SET("DATE") while the focus is in a text box, the SelStart property is reset to 0, placing the insertion point before the first character. This occurs even if the form is in a different data session than the one in which you perform the SET DATE.
RESOLUTION
You can partially work around this behavior by saving and restoring the SelStart property in the routine that performs the SET DATE.
FOR i = 1 TO _SCREEN.FormCount
loScreenForm = _SCREEN.Forms(i)
IF TYPE("loScreenForm.ActiveControl.SelStart") = "N"
loScreenForm.Tag = STR(loScreenForm.ActiveControl.SelStart)
ENDIF
ENDfor
SET DATE TO (SET("DATE")) && This line will reset the SelStart property.
FOR i = 1 TO _SCREEN.FormCount
loScreenForm = _SCREEN.Forms(i)
IF TYPE("loScreenForm.ActiveControl.SelStart") = "N"
loScreenForm.ActiveControl.SelStart = VAL(loScreenForm.Tag)
ENDIF
ENDFOR
Modification Type: | Major | Last Reviewed: | 5/12/2003 |
---|
Keywords: | kbBug kbCodeSnippet kbnofix kbprb KB313196 |
---|
|