Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
12/26/21 20:49:51 (2 years ago)
Author:
gkronber
Message:

#3047: set SuppressKeyPress=true in all controls that handle the Enter key explicitly (except for dialogs).

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/HeuristicLab.Core.Views/3.3/NamedItemView.cs

    r17180 r18166  
    119119    }
    120120    protected virtual void nameTextBox_KeyDown(object sender, KeyEventArgs e) {
    121       if ((e.KeyCode == Keys.Enter) || (e.KeyCode == Keys.Return))
     121      if ((e.KeyCode == Keys.Enter) || (e.KeyCode == Keys.Return)) {
    122122        nameLabel.Focus();  // set focus on label to validate data
    123       if (e.KeyCode == Keys.Escape) {
     123        e.SuppressKeyPress = true;
     124      } else if (e.KeyCode == Keys.Escape) {
    124125        nameTextBox.Text = Content.Name;
    125126        nameLabel.Focus();  // set focus on label to validate data
     127        e.SuppressKeyPress = true;
    126128      }
    127129    }
Note: See TracChangeset for help on using the changeset viewer.