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

RadTextBox& maskedEditBox KeyDown override

1 Answer 123 Views
TextBox
This is a migrated thread and some comments may be shown as answers.
Roya
Top achievements
Rank 1
Roya asked on 14 May 2012, 07:15 AM

Hello

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

 

 

base.OnKeyDown(e);

 


}

but when i use the component in the program this event doesnt happen.please help me

1 Answer, 1 is accepted

Sort by
0
Peter
Telerik team
answered on 16 May 2012, 04:57 PM
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,
Peter
the Telerik team
RadControls for WinForms Q1'12 release is now live! Check out what's new or download a free trial >>
Tags
TextBox
Asked by
Roya
Top achievements
Rank 1
Answers by
Peter
Telerik team
Share this question
or