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?

  • 53790
    posted

    Hi,

    I suppose that this forum thread is duplicate with this thread http://forums.infragistics.com/forums/t/65895.aspx  . Please look my answer there and let me know if you have any questions.

    Regards

  • 469350
    Offline posted

    Hi,

    I'm a bit confused. You don't need to do anything to get the Backspace key to remove the last character typed. This is the default behavior of any text-based control.

    So I'm not clear what you are trying to do or why.