Hi Steve,
Thanks for your feedback on this issue. This is a known shortcoming in the .NET framework and this is how the .NET MainMenu behaves too. To workaround this problem, handle the edit box (RichTextBox has been used in this sample) GotFocus and LostFocus events to set or reset the corresponding BarItem''s Shortcut.
private void richTextBox1_GotFocus (object sender, EventArgs e)
{
this.barItem3.Shortcut = Shortcut.None;
}
private void richTextBox1_LostFocus (object sender, EventArgs e)
{
this.barItem3.Shortcut = Shortcut.Del;
}
The
test sample attached here illustrates this workaround. As long as the RichTextBox has focus the Shortcut is disabled, and hence the delete key has the desired effect on the RichTextBox. If you tab out of the RichTextBox such that the Button has focus, Delete shortcut gets reassigned and pressing the Delete key will fire the Click event of the BarItem. Please refer to it and let me know if this works for you.
Regards,
Guru Patwal
Syncfusion, Inc.