'case Keys.Control | Keys.C:' ---> Doesn't work on 2.0???!

U

Udi

Hi,
I have a user control derived from RichTextBox.
I recently ported the control from 1.1 to 2.0.
While everything worked fine on 1.1, for some reason it doesn't on 2.0.
Any ideas why?

The code:

protected override void OnKeyDown(KeyEventArgs e)
{
switch (e.KeyData)
{
case Keys.Control | Keys.C:
{
: // Not stopping here on 2.0.
Why???
}
:
}

}
 
C

Chris Dunaway

Udi wrote:

On a plain form, this works for me:

switch (e.KeyData)
{
case (Keys.Control | Keys.C):
MessageBox.Show("Control-C Pressed!");
break;
}


So something else must be affecting it. Have you double checked the
location of the code to make sure it is in the right place? Could
there be some other control on your user control that is consuming the
event so that the control never receives it?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top