DataGridViewHeaderCell.MouseDownUnsharesRow(DataGridViewCellMouseEventArgs) 方法

定义

指示当鼠标指针位于行中某个单元格上并按下鼠标按钮时,该行是否取消共享状态。Indicates whether a row will be unshared when the mouse button is held down while the pointer is on a cell in the row.

protected:
 override bool MouseDownUnsharesRow(System::Windows::Forms::DataGridViewCellMouseEventArgs ^ e);
protected override bool MouseDownUnsharesRow (System.Windows.Forms.DataGridViewCellMouseEventArgs e);
override this.MouseDownUnsharesRow : System.Windows.Forms.DataGridViewCellMouseEventArgs -> bool
Protected Overrides Function MouseDownUnsharesRow (e As DataGridViewCellMouseEventArgs) As Boolean

参数

e
DataGridViewCellMouseEventArgs

DataGridViewCellMouseEventArgs,它包含有关鼠标位置的信息。A DataGridViewCellMouseEventArgs that contains information about the mouse position.

返回

Boolean

如果用户单击鼠标左键,启用了可视样式,而且 EnableHeadersVisualStyles 属性是 true,则为 true;否则为 falsetrue if the user clicks with the left mouse button, visual styles are enabled, and the EnableHeadersVisualStyles property is true; otherwise, false.

注解

有关启用视觉样式的信息,请参阅 Application.EnableVisualStyles 方法。For information about enabling visual styles, see the Application.EnableVisualStyles method.

MouseDownUnsharesRow 在之前调用 OnMouseDownMouseDownUnsharesRow is called just before OnMouseDown. 如果对的 true 调用 OnMouseDown 具有取消共享行的效果,则该方法必须返回 rowIndexIt must return true if the call to OnMouseDown has the effect of unsharing the row rowIndex. 否则应返回 falseIt should return false otherwise.

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

适用于

另请参阅