-
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
-
Try this:
Code:
Case vbKeyRight:
SendKeys "^z", True
This will undo what was done.
-
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.