DataGridView.ProcessF2Key(Keys) 方法

定义

处理 F2 键。Processes the F2 key.

protected:
 bool ProcessF2Key(System::Windows::Forms::Keys keyData);
protected bool ProcessF2Key (System.Windows.Forms.Keys keyData);
member this.ProcessF2Key : System.Windows.Forms.Keys -> bool
Protected Function ProcessF2Key (keyData As Keys) As Boolean

参数

keyData
Keys

Keys 值的按位组合,这些值表示要处理的一个或多个键。A bitwise combination of Keys values that represents the key or keys to process.

返回

如果已处理该键,则为 true;否则为 falsetrue if the key was processed; otherwise, false.

异常

按下 F2 键将导致控件进入编辑模式,但当前单元格的 EditType 属性不指示派生自 Control 并实现 IDataGridViewEditingControl的类。The F2 key would cause the control to enter edit mode, but the EditType property of the current cell does not indicate a class that derives from Control and implements IDataGridViewEditingControl.

按下 F2 键将导致控件进入编辑模式,但数据源中的错误会阻止操作,并且没有 DataError 事件的处理程序或处理程序已将 ThrowException 属性设置为 trueThe F2 key would cause the control to enter edit mode, but an error in the data source prevents the action and either there is no handler for the DataError event or the handler has set the ThrowException property to true.

安全性

SecurityPermission
用于调用非托管代码。for calling unmanaged code. 需求值: LinkDemandDemand value: LinkDemand. 权限值: UnmanagedCodePermission value: UnmanagedCode

适用于

另请参阅