|
|
Processing "Control + C" keys in RichTextBox.KeyDown()
Hi there,
I'm using a RichTextBox to create a custom editor, my class inherits from
it. I've set to false the property ShortcutsEnabled and I need to handle the
combination of keys Control + C. I've tried it in many ways using the
modifiers of the KeyEventArgs, using GetKeyboardState(), using GetKeyState()
in the RichEdit KeyDown event but it doesn’t work.
I think the problem is that when the user press both keys the event is not
fired for some reason, because if I check for the control key only it works
and the same for the C key but when both are pressed it doesn’t work.
Can someone explain me why this is happening?
How can I handle these keys combination?
Thank you in advance,
Robe.
|
|
0
|
|
|
|
Reply
|
Utf
|
11/19/2009 5:30:01 PM |
|
Robe wrote:
> Hi there,
>
> I'm using a RichTextBox to create a custom editor, my class inherits from
> it. I've set to false the property ShortcutsEnabled and I need to handle the
> combination of keys Control + C. I've tried it in many ways using the
> modifiers of the KeyEventArgs, using GetKeyboardState(), using GetKeyState()
> in the RichEdit KeyDown event but it doesn’t work.
>
> I think the problem is that when the user press both keys the event is not
> fired for some reason, because if I check for the control key only it works
> and the same for the C key but when both are pressed it doesn’t work.
>
> Can someone explain me why this is happening?
> How can I handle these keys combination?
The KeyEventArgs passed to your KeyDown event handler includes modifier
key state. So if you're having trouble, it's because your event handler
isn't written correctly.
For more specific advice on in what way your event handler isn't written
correctly, you will at a minimum need to post that event handler. For
best results, post a concise-but-complete code example that reliably
demonstrates the problem.
Pete
|
|
0
|
|
|
|
Reply
|
Peter
|
11/19/2009 6:25:16 PM
|
|
|
1 Replies
373 Views
(page loaded in 0.039 seconds)
Similiar Articles: Processing "Control + C" keys in RichTextBox.KeyDown ...Hi there, I'm using a RichTextBox to create a custom editor, my class inherits from it. I've set to false the property ShortcutsEnabled and I nee... gridview on a tab control - microsoft.public.dotnet.framework ...Capturing ctrl keys in form KeyDown - microsoft.public.dotnet ... see inline >>> >>> Select Case e.KeyCode >>> Case Keys.C >>> If e.Modifiers = Keys.Control Then msgbox ... Populate a control with a value from a previous record - microsoft ...... previous record. ... Recordset, C As Control ... Need Enter key to populate field with ... on Bytes. ... >>might use the KeyDown event to test if the Text of the control is ... How to correctly pop a modeless dialog from console using MFC ...... start with 1 thread called the main process thread and ... proc that will detect various signals, like control-c ... doug_web/threads.htm#Q6 Also, I'd look for WM_KEYDOWN ... Update All (Cntrl A) Does Not Work - microsoft.public.word ...... bridge when we come to it, as the extra processing ... Capturing ctrl keys in form KeyDown - microsoft.public.dotnet ... on laptop [Solved] | Kioskea.net... control keys have ... Opening up in RichTextBox2 ? - microsoft.public.dotnet.languages ...... it to > assign to the Text property of the RichTextBox control. ... and where line feeds were added during the process ... stick the line's date into a SortedList as the key ... VB6 support and beyond - microsoft.public.vb.general.discussion ...I previously worked and combined many technologies C ... of promoting their platform, they also gave away VB6 Control ... Key Visual Basic 6.0 runtime files, used in the majority ... Processing "Control + C" keys in RichTextBox.KeyDown() .NET FrameworkHi there, I am using a RichTextBox to create a custom editor, my class inherits from it. I have set to false the property ShortcutsEnabled and I need to Control.KeyDown Event (System.Windows.Forms)Occurs when a key is pressed while the control has focus. ... To have these keys raise the KeyDown event, you must override the IsInputKey ... 8/1/2012 2:40:42 PM
|
|
|
|
|
|
|
|
|