DataGridViewCell.KeyDownUnsharesRow(KeyEventArgs, Int32) 方法

定义

指示在焦点位于单元格上,同时用户按任意键时,是否对父行取消共享。Indicates whether the parent row is unshared if the user presses a key while the focus is on the cell.

protected:
 virtual bool KeyDownUnsharesRow(System::Windows::Forms::KeyEventArgs ^ e, int rowIndex);
protected virtual bool KeyDownUnsharesRow (System.Windows.Forms.KeyEventArgs e, int rowIndex);
abstract member KeyDownUnsharesRow : System.Windows.Forms.KeyEventArgs * int -> bool
override this.KeyDownUnsharesRow : System.Windows.Forms.KeyEventArgs * int -> bool
Protected Overridable Function KeyDownUnsharesRow (e As KeyEventArgs, rowIndex As Integer) As Boolean

参数

e
KeyEventArgs

包含事件数据的 KeyEventArgsA KeyEventArgs that contains the event data.

rowIndex
Int32

该单元格的父行索引。The index of the cell's parent row.

返回

Boolean

如果不共享该行,则为 true;否则为 falsetrue if the row will be unshared, otherwise, false. DataGridViewCell 基类总是返回 falseThe base DataGridViewCell class always returns false.

注解

KeyDownUnsharesRow方法在方法之前调用 OnKeyDownThe KeyDownUnsharesRow method is called just before the OnKeyDown method. true如果对 OnKeyDown 具有相同参数的调用具有取消 KeyEventArgs 共享包含该单元格的行的效果,则该方法必须返回。It must return true if the call to OnKeyDown with the same KeyEventArgs argument has the effect of unsharing the row containing the cell. 否则,它应返回 falseOtherwise, it should return false.

有关行共享的详细信息,请参阅 缩放 Windows 窗体 DataGridView 控件的最佳做法For more information about row sharing, see Best Practices for Scaling the Windows Forms DataGridView Control.

适用于

另请参阅