DataGridViewTextBoxCell.KeyEntersEditMode(KeyEventArgs) 方法

定义

确定是否应基于给定键启动编辑模式。Determines if edit mode should be started based on the given key.

public:
 override bool KeyEntersEditMode(System::Windows::Forms::KeyEventArgs ^ e);
public override bool KeyEntersEditMode (System.Windows.Forms.KeyEventArgs e);
override this.KeyEntersEditMode : System.Windows.Forms.KeyEventArgs -> bool
Public Overrides Function KeyEntersEditMode (e As KeyEventArgs) As Boolean

参数

e
KeyEventArgs

一个 KeyEventArgs,表示按下的键。A KeyEventArgs that represents the key that was pressed.

返回

如果应启动编辑模式,则为 true;否则为 falsetrue if edit mode should be started; otherwise, false.

注解

DataGridView 控件的 EditMode 属性设置为 EditOnKeystrokeEditOnKeystrokeOrF2时,控件将使用此方法来确定在此单元格有焦点的情况下,用户按下的键是否为按下的键。When the EditMode property of the DataGridView control is set to EditOnKeystroke or EditOnKeystrokeOrF2, the control uses this method to determine whether a key other than F2 that is pressed by the user while this cell has focus will cause the cell to enter edit mode.

如果 e 参数指示不修改的普通数据输入键(如字母、数字、标点符号或空格键),则此方法将返回 true,其中不包括 SHIFT + SPACE,此控件用于选择。This method returns true if the e parameter indicates an ordinary data-entry key (such as a letter, number, punctuation mark, or the SPACE key) unmodified by ALT or CTRL, excluding SHIFT+SPACE, which is used by the control for selection purposes. 有关详细信息,请参阅Windows 窗体 DataGridView 控件中的默认键盘和鼠标处理For more information, see Default Keyboard and Mouse Handling in the Windows Forms DataGridView Control.

适用于

另请参阅