DataGridViewCell.KeyDownUnsharesRow(KeyEventArgs, Int32) DataGridViewCell.KeyDownUnsharesRow(KeyEventArgs, Int32) DataGridViewCell.KeyDownUnsharesRow(KeyEventArgs, Int32) DataGridViewCell.KeyDownUnsharesRow(KeyEventArgs, Int32) Method

定義

指出當焦點在儲存格上,而使用者按下按鍵時,是否取消共用父資料列。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 KeyEventArgs KeyEventArgs KeyEventArgs

KeyEventArgs,其中包含事件資料。A KeyEventArgs that contains the event data.

rowIndex
Int32 Int32 Int32 Int32

儲存格的父資料列索引。The index of the cell's parent row.

傳回

如果會取消共用資料列則為 true,否則為 falsetrue if the row will be unshared, otherwise, false. 基底 DataGridViewCell 類別永遠會傳回 falseThe base DataGridViewCell class always returns false.

備註

方法只會在OnKeyDown方法之前呼叫。 KeyDownUnsharesRowThe KeyDownUnsharesRow method is called just before the OnKeyDown method. true如果OnKeyDown使用相同的引數呼叫,其影響會使包含儲存格的資料列取消共用,則必須傳回。KeyEventArgsIt must return true if the call to OnKeyDown with the same KeyEventArgs argument has the effect of unsharing the row containing the cell. 否則,它應該false會傳回。Otherwise, it should return false.

如需有關資料列共用的詳細資訊,請參閱縮放 Windows Forms DataGridView 控制項的最佳做法For more information about row sharing, see Best Practices for Scaling the Windows Forms DataGridView Control.

適用於

另請參閱