Results 1 to 3 of 3

Thread: How do I get this to return the text (like in dos)

  1. #1

    Thread Starter
    Frenzied Member
    Join Date
    Jun 2000
    Location
    East Providence, RI
    Posts
    1,715
    here is my current code:
    Code:
    Private Sub txtLine1_KeyDown(KeyCode As Integer, Shift As Integer)
    On Error Resume Next
    Select Case KeyCode
        Case vbKeyLeft:
        txtLine1.Text = Left(txtLine1.Text, Len(txtLine1.Text) - 1)
        txtLine1.SelStart = Len(txtLine1.Text) & " "
        txtLine1.SetFocus
        SendKeys "{END}"
    
        Case vbKeyControl:
        KeyCode = 0
        
        Case vbKeyRight:
        KeyCode = 0
        
        Case vbKeyUp:
        KeyCode = 0
        
        Case vbKeyDown:
        KeyCode = 0
        
        Case vbKeyHome:
        KeyCode = 0
        
        Case vbKeyDelete:
        KeyCode = 0
        
        Case vbKeyEscape:
        SendKeys "`", True
        
        Case vbKeySnapshot:
        frmDOS.PrintForm
        End Select
    
    End Sub
    now when someone clicks the left arrow it deletes the stuff from the right (just like dos)
    now how do I get it restore what was there when someone clicks the right arrow (just like in dos)?

    thanks in advance


    Dimava
    NXSupport - Your one-stop source for computer help

  2. #2
    Guest
    Try this:

    Code:
    Case vbKeyRight:
        SendKeys "^z", True
    This will undo what was done.

  3. #3
    Fanatic Member
    Join Date
    Mar 2000
    Location
    That posh bit of England known as Buckinghamshire
    Posts
    658
    If i remember correctly, to get DOS to remember what was typed for more than the current command, you had to load the DOSKEY program.

    The way i think it worked, is it kept a list of what had been typed in. I suggest you keep what has been typed into the text box, and work on that, depending on the cursor position.

    And by the way, if you press the left key in DOS, it does not delete anything. The backspace key does that job, as it should, but pressing the right key, restores what has been deleted.
    Iain, thats with an i by the way!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width