This is a migrated thread and some comments may be shown as answers.

TabStrip captures arrow keys, ProcessCmdKey will not override that behavior

1 Answer 91 Views
Tabstrip (obsolete as of Q2 2010)
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
David
Top achievements
Rank 1
David asked on 15 Sep 2010, 03:50 AM
I'm working with 2010 Q1, and I cannot override ProcessCmdKey to trap the left and right arrow key events.  It will work in a form without the tabstrip, but not in a form with a tabstrip.  Is this a known issue?

My project is pretty far along using this version, and converting to the new version would basically require writing a new project and copying the code over.  The automatic upgrade stuff in 2010 Q2 SP1 is not appearing, probably due to the fact that my project uses Q1 dlls.  Replacing those dlls with Q2 versions causes a multitude of errors to appear.

Any ideas?

thanks,

David

1 Answer, 1 is accepted

Sort by
0
Stefan
Telerik team
answered on 20 Sep 2010, 03:34 PM
Hello David,

Thank you for writing.

You could try to override ProcessCmdKey as shown in the following code snippet:
 
protected override bool ProcessCmdKey(ref Message msg, Keys keyData)
{
        if (keyData == Keys.Left)
        {
            base.ProcessCmdKey(ref msg, keyData);
            return false;
        }
        return base.ProcessCmdKey(ref msg, keyData);
}
 
This will prevent from stopping the event forwarding to radTabStrip1.KeyDown event and you will be able to catch in there, as shown in the next code snippet:
 
void radTabStrip1_KeyDown(object sender, KeyEventArgs e)
{
    if (e.KeyData == Keys.Left)
    {
//Left arrow is pressed. Do something
    }
}

 
A bit off topic, please ask the person who has purchased our controls in your company to add you as a License Developer to the purchase. This will give you full access to the products your company has purchased, to our downloads section, and to our support ticketing system. Additionally, all your questions will be reviewed according to the license you have. More information on License Developers you can find here: www.telerik.com/account/faqs.aspx.

 
All the best,
Stefan
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
Tags
Tabstrip (obsolete as of Q2 2010)
Asked by
David
Top achievements
Rank 1
Answers by
Stefan
Telerik team
Share this question
or