|
-
Sep 8th, 2007, 01:53 AM
#1
Thread Starter
Junior Member
Using BackSpace in Text box
In programs I'm writing in VB5, I would like to give the User the option to remove the last character in a text box using the backspace key.
I use this code in a _keypress event procedure :
If ........... then
................
elseif ................. then
................
elseif ................. then
.................
elseif keyascii = 8 then
txtABC.text = Left$(txtABC.text, len(txtABC.text) - 1)
else
..................
end if
This does the job allright, BUT when the shortened text string is displayed in the text box, the cursor is placed at the start of the line of text, whereas I
would prefer it was placed at the end of the string where it should be.
Is there any code I can add to force the cursor to the end of string.
Warren Sugden
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|