RadTextBox& maskedEditBox KeyDown override

2 posts, 0 answers
  1. Roya
    Roya avatar
    26 posts
    Member since:
    Jan 2012

    Posted 14 May 2012 Link to this post


    I Used a RadTextBox and  maskedEditBox in an component,and also wrote key Down event for both of them.




    protected override void OnKeyDown(KeyEventArgs e)


    ////  -- some codes






    but when i use the component in the program this event doesnt happen.please help me
  2. Peter
    Peter avatar
    1148 posts

    Posted 16 May 2012 Link to this post

    Hello Roya,

    Thank you for contacting Telerik support.

    The OnKeyDown method is inherited from the controls' Elements (in your case RadMaskedEditBoxElement, RadTextBoxElement).

    In case that you inherit from them, this override should behave correctly.
    Another approach is to subscribe to the KeyDown event: 

    radMaskedEditBox1.KeyDown += new KeyEventHandler(radMaskedEditBox1_KeyDown);

    I hope this helps. Kind regards,
    the Telerik team
    RadControls for WinForms Q1'12 release is now live! Check out what's new or download a free trial >>
Back to Top