DataGridViewCell.LeaveUnsharesRow(Int32, Boolean) DataGridViewCell.LeaveUnsharesRow(Int32, Boolean) DataGridViewCell.LeaveUnsharesRow(Int32, Boolean) DataGridViewCell.LeaveUnsharesRow(Int32, Boolean) Method

定义

指示在焦点离开某行的单元格时,是否对该行取消共享。Indicates whether a row will be unshared when the focus leaves a cell in the row.

protected:
 virtual bool LeaveUnsharesRow(int rowIndex, bool throughMouseClick);
protected virtual bool LeaveUnsharesRow (int rowIndex, bool throughMouseClick);
abstract member LeaveUnsharesRow : int * bool -> bool
override this.LeaveUnsharesRow : int * bool -> bool
Protected Overridable Function LeaveUnsharesRow (rowIndex As Integer, throughMouseClick As Boolean) As Boolean

参数

rowIndex
Int32 Int32 Int32 Int32

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

throughMouseClick
Boolean Boolean Boolean Boolean

如果用户操作将焦点移至该单元格,则为 true;如果编程操作将焦点移至该单元格,则为 falsetrue if a user action moved focus to the cell; false if a programmatic operation moved focus to the cell.

返回

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

注解

LeaveUnsharesRow之前调用方法OnLeave方法。The LeaveUnsharesRow method is called just before the OnLeave method. 它必须返回true如果在调用OnLeave的取消共享已包含该单元格的行的效果。It must return true if the call to OnLeave 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.

适用于

另请参阅