FIX: SelText Does Not Return Last Character in Text Box |
Q183257
If the selected text within a textbox includes the last character of the controls Text property, the SelText property will not include the last character.
To work around this problem, you can use the SelStart and SelLength
properties to capture the selected string:
Dim strSelected
If Text1.SelLength > 0 then
strSelected = Mid(Text1.Text, Text1.SelStart + 1, Text1.SelLength)
End If
Microsoft has confirmed this to be a problem in the Microsoft products that are listed
at the beginning of this article.
This problem was corrected in Windows CE Toolkit for Visual Basic 6.0.
When the selected text includes the last character of the control's Text
property, the SelText property will not include the last character.
For example, assume a textbox control contains the characters "this is a
test" (without the quotation marks):
+----------------------------------------------------------------+
| If the selected text is: | SelText Property |
+----------------------------------------------------------------+
| "is a test" | "is a tes" |
+----------------------------------------------------------------+
| "This is a" | "This is a" |
+----------------------------------------------------------------+
Books Online for Microsoft Windows CE Toolkit for Visual Basic 5.0
Additional query words: VBCE wce selection vbce5 vbce6
Keywords : kbToolkit kbVBp kbVBp500bug kbVBp600fix kbOSWinCEsearch kbOSWinCE100 kbGrpDSVB
Issue type : kbbug
Technology : kbVBSearch kbAudDeveloper kbWinCETKVBSearch kbWinCESearch kbWinCETK100VB500
|
Last Reviewed: March 6, 1999 © 2001 Microsoft Corporation. All rights reserved. Terms of Use. |