PRB: SelectOnEntry Property Does Not Highlight Single CharacterLast reviewed: July 29, 1997Article ID: Q171983 |
The information in this article applies to:
SYMPTOMSWhen setting the SelectOnEntry property in Visual FoxPro 5.0 to True (.T.), a single character is not highlighted when the object receives focus with some objects. Of all the objects in Visual FoxPro 5.0 that use the SelectOnEntry property, the TextBox and ComboBox are the ones that do not highlight a single character properly. The EditBox, Spinner, and Grid column objects highlight a single character properly. If any of the object just mentioned has more than one character in it, then the characters are highlighted properly when the SelectOnEntry is set to True. The same problem occurs when using the "K" setting in the Format property of the TextBox or ComboBox. Setting the Format property to "K" selects all text when the object receives focus. The SelectOnEntry property was not available in Visual FoxPro 3.0. The Format property value of "K" works properly with just one character in Visual FoxPro 3.0 and, therefore, the workaround below is not necessary. The ComboBox in Visual FoxPro 3.0 does not have a Format property or the SelectOnEntry property.
RESOLUTIONTo allow a single character to become highlighted in a TextBox or ComboBox, check the length of the value to see if it is a single character. If it is only one character in length, using the KEYBOARD command allows the character to be highlighted. Place the following code into the Gotfocus event:
IF LEN(ALLTRIM(THIS.VALUE)) = 1 && Use This.Value works for * textboxes, KEYBOARD '{shift + home}' && and This.DisplayValue for * Comboboxes. KEYBOARD '{shift + rightarrow}' ENDIF STATUSMicrosoft has confirmed this to be a problem in the Microsoft products listed at the beginning of this article. We are researching this problem and will post new information here in the Microsoft Knowledge Base as it becomes available.
MORE INFORMATION
Steps to Reproduce Behavior
|
Additional query words: form designer
© 1998 Microsoft Corporation. All rights reserved. Terms of Use. |