DataGridViewCell.KeyPressUnsharesRow(KeyPressEventArgs, Int32) DataGridViewCell.KeyPressUnsharesRow(KeyPressEventArgs, Int32) DataGridViewCell.KeyPressUnsharesRow(KeyPressEventArgs, Int32) DataGridViewCell.KeyPressUnsharesRow(KeyPressEventArgs, Int32) Method

定義

指出在資料列中的儲存格具有焦點時,如果按下按鍵,資料列是否將進行取消共用。Indicates whether a row will be unshared if a key is pressed while a cell in the row has focus.

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

參數

e
KeyPressEventArgs KeyPressEventArgs KeyPressEventArgs KeyPressEventArgs

KeyPressEventArgs,其中包含事件資料。A KeyPressEventArgs 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.

備註

方法只會在OnKeyPress方法之前呼叫。 KeyPressUnsharesRowThe KeyPressUnsharesRow method is called just before the OnKeyPress method. 在衍生類別中, true如果的OnKeyPress呼叫具有將包含儲存格的資料列取消共用的效果,則必須傳回。In derived classes, it must return true if the call to OnKeyPress 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.

適用於

另請參閱