Skip Navigation LinksHome / Community & Support / Developer Productivity Tools Forums / WinForms > Tabstrip (obsolete as of Q2 2010) > TabStrip captures arrow keys, ProcessCmdKey will not override that behavior

Not answered TabStrip captures arrow keys, ProcessCmdKey will not override that behavior

Feed from this thread
  • David avatar

    Posted on Sep 14, 2010 (permalink)

    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

    Reply

  • Stefan Stefan admin's avatar

    Posted on Sep 20, 2010 (permalink)

    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

    Reply

Back to Top

Skip Navigation LinksHome / Community & Support / Developer Productivity Tools Forums / WinForms > Tabstrip (obsolete as of Q2 2010) > TabStrip captures arrow keys, ProcessCmdKey will not override that behavior
Related resources for "TabStrip captures arrow keys, ProcessCmdKey will not override that behavior"

[ Features | Demos | Documentation | Knowledge Base | Telerik TV | Code Library | Step-by-step Tutorial | Blogs | Self-Paced Trainer ]