ADO DOT NET
Centurion
- Joined
- Dec 20, 2006
- Messages
- 160
Hi
I was using this in VB6:
I just copied it from my old code!
Most of features are not supported!
I just want to know that now how can determine the pressing of the following keys in a text box
Ctrl + Z
Ctrl + X
Ctrl + A
Ctrl + V
Ctrl + A
Delete !
I was using this in VB6:
Visual Basic:
Private Sub SubjectTextBox_KeyDown(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyEventArgs) Handles SubjectTextBox.KeyDown
On Error Resume Next
If (KeyCode = vbKeyZ) And (Shift = vbCtrlMask) Then
SendKeys("^Z")
End If
If (KeyCode = vbKeyX) And (Shift = vbCtrlMask) Then
Clipboard.Clear()
Clipboard.SetText(Subject.SelText)
Subject.SelText = ""
End If
If (KeyCode = vbKeyC) And (Shift = vbCtrlMask) Then
Clipboard.Clear()
Clipboard.SetText(Subject.SelText)
End If
If (KeyCode = vbKeyV) And (Shift = vbCtrlMask) Then
Subject.SelText = Clipboard.GetText
End If
If (KeyCode = vbKeyA) And (Shift = vbCtrlMask) Then
Subject.SelStart = 0
Subject.SelLength = Len(Subject.Text)
End If
End Sub
Private Sub SubjectTextBox_KeyUp(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyEventArgs) Handles SubjectTextBox.KeyUp
On Error Resume Next
If KeyCode = vbKeyDelete Then
If Subject.SelLength = 0 Then Subject.SelLength = 1
Subject.SelText = ""
End If
End Sub
Most of features are not supported!
I just want to know that now how can determine the pressing of the following keys in a text box
Ctrl + Z
Ctrl + X
Ctrl + A
Ctrl + V
Ctrl + A
Delete !