Link to home
Start Free TrialLog in
Avatar of maidinhtai
maidinhtai

asked on

Ctrl+X, Ctrl+V, Ctrl+C or Cut, Copy, Paste using the keyboard -> What are their keycode or keychar?

The title says all. For example, what is the keychar or keycode of Ctrl+X. Thank you.
SOLUTION
Avatar of PockyMaster
PockyMaster
Flag of Netherlands image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of maidinhtai
maidinhtai

ASKER

Hi PockyMaster. This is a clear example:
----------------------------------------
Private Sub TextBox1_PreviewKeyDown(ByVal sender As Object, ByVal e As System.Windows.Forms.PreviewKeyDownEventArgs) Handles TextBox1.PreviewKeyDown
         If e.Control And e.KeyCode = Keys.V Then
             'Do nothing
    End Sub
-----------------------------------------
What I need is when the user press Ctrl+V, nothing will happen. That means the text in Clipboard is not pasted into textbox1.
Avatar of Bob Learned
e.KeyCode = Keys.None

   or

e.IsInputKey = False

Bob
ASKER CERTIFIED SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Yeah, like I said before, use the keydown event
TheLearnedOne, where can I put wher
TheLearnedOne, where can I put "e.KeyCode = Keys.None" or "e.IsInputKey = False"? If I put it to KeyDown event, so appri's answer is OK.
In PreviewKeyDown, but appari's answer will work, too.

Bob
In the Subroutine that handles  the PreViewKeyDown event, e.KeyCode is readonly, and e.IsInputKey = False seems useless (I mean it does nothing at all). I try changing e.IsInputKey = False to e.IsInputKey = True but there nothing different, too.