override onkeydown in radmaskededitbox
1 Answer 9 Views
Roh
Top achievements
Rank 1
Roh asked on 04 May 2021, 10:44 AM

Hi.  I want to bring a custom control that inherits from RasMaskedEditBox. But onKeyDown and OnKeyPress events do not fired.

public class myMask: Radmaskededitbox

{

protected override void OnKeyDown(KeyEventArgs e)

{

//My codes

}

}

 

1 Answer, 1 is accepted

Sort by
0
Dess | Tech Support Engineer, Principal
Telerik team
answered on 05 May 2021, 01:36 PM

Hi, Roh,

RasMaskedEditBox internally hosts the standard MS TextBox. Hence, it handles the keyboard input. The following code snippet demonstrates how to handle the KeyDown event in the hosted control:

        public RadForm1()
        {
            InitializeComponent();

            this.radMaskedEditBox1.MaskedEditBoxElement.TextBoxItem.TextBoxControl.KeyDown+=TextBoxControl_KeyDown; 
        }
          
        private void TextBoxControl_KeyDown(object sender, KeyEventArgs e)
        {
            Console.WriteLine("KeyDown");
        }

I hope this information helps. If you need any further assistance please don't hesitate to contact me. 

Regards,
Dess | Tech Support Engineer, Sr.
Progress Telerik

Love the Telerik and Kendo UI products and believe more people should try them? Invite a fellow developer to become a Progress customer and each of you can get a $50 Amazon gift voucher.

Asked by
Roh
Top achievements
Rank 1
Answers by
Dess | Tech Support Engineer, Principal
Telerik team
Share this question
or