Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Backspacing

Status
Not open for further replies.

goatsaregreat

Programmer
Mar 21, 2001
82
GB
Is there anyway to backspace in a text box without using the keyboard? Actually, I know there is a way, I just can't think of it. :) I need a mouse interface, no keyboard work. I have a number pad set up using command buttons and all the numbers work fine, but the backspace button is driving me nuts. Thanks for your help. :)
 
textbox1.SelStart = position
textbox1.SelLength = 0

Wil Mead
wmead@optonline.net

 
Backspace (not left arrow)
Code:
Private Sub cmdBackSpace_Click()
    ' if there is highlighted text, backspace just
    ' deletes the highlighted text 
    if txt.SelLength > 0 then
        txt.SelText = ""
    else
        ' else it
        ' deletes the prevuious character. 
        if txt.SelStart > 0 
            txt.SelStart = txt.SelStart - 1
            txt.SelLength = 1
            txt.SelText = ""
        End if
    End if
End Sub
Compare Code (Text)
Generate Sort in VB or VBScript
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top