Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
1540
EventHandler Backspace (two approaches)
posted

I want to catch a Backspace control event and delete the last character that my user wrote on a ultracomboEditor.

I've tried both of approaches but they doesnt work..

Approach 1:

protected override bool ProcessCmdKey(ref Message msg, Keys keyData)
   
{
       
if (keyData == Keys.Back)
           
OnKeyPress(new KeyPressEventArgs((Char)Keys.Back));


       
return base.ProcessCmdKey(ref msg, keyData);
   
}


Approcah 2:


private void ultraComboLeftEyeAxis_KeyPress(object sender, KeyEventArgs e)
   
{
       
if (e.KeyCode == Keys.Back)
       
{
            e
.Handled = true;
       
}
   
}



 
this.ultraComboLeftEyeAxis.KeyPress += new System.EventHandler(this.ultraComboLeftEyeAxis_KeyPress);

Can you help me?

Parents
No Data
Reply Children
No Data