Completed
Last Updated: 04 Feb 2016 08:00 by ADMIN
ADMIN
Dimitar
Created on: 08 Jan 2016 07:12
Category: Form
Type: Bug Report
0
FIX. RadForm - the AcceptButton Click event is fired when another button is focused and Enter is pressed.
To reproduce:
- Add two buttons and a textbox to a RadForm.
- Set the AcceptButton to be the first button.
- Focus the second button and press Enter

Workaround:
protected override bool ProcessCmdKey(ref System.Windows.Forms.Message msg, System.Windows.Forms.Keys keyData)
{
    if (keyData == System.Windows.Forms.Keys.Enter)
    {
        if (this.ActiveControl is Button && this.ActiveControl != this.AcceptButton)
        {
            ((Button)this.ActiveControl).PerformClick();
            return true;
        }
        
    }

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