DataGridViewHeaderCell.OnMouseUp(DataGridViewCellMouseEventArgs) 方法

定義

當指標位於儲存格上方,放開滑鼠按鈕時即會呼叫。Called when the mouse button is released while the pointer is over the cell.

protected:
 override void OnMouseUp(System::Windows::Forms::DataGridViewCellMouseEventArgs ^ e);
protected override void OnMouseUp (System.Windows.Forms.DataGridViewCellMouseEventArgs e);
override this.OnMouseUp : System.Windows.Forms.DataGridViewCellMouseEventArgs -> unit
Protected Overrides Sub OnMouseUp (e As DataGridViewCellMouseEventArgs)

參數

e
DataGridViewCellMouseEventArgs

DataGridViewCellMouseEventArgs,包含滑鼠位置的相關資訊。A DataGridViewCellMouseEventArgs that contains information about the mouse position.

備註

如果已放開滑鼠ButtonState左鍵Normal ,方法會將設為,並為標頭啟用視覺化樣式。OnMouseUpThe OnMouseUp method sets the ButtonState to Normal if the left mouse button was released and visual styles are enabled for headers. 如需標頭視覺化樣式的詳細資訊, 請DataGridView.EnableHeadersVisualStyles參閱屬性。For more information about visual styles for headers, see the DataGridView.EnableHeadersVisualStyles property.

這個方法與DataGridView.OnCellMouseUp方法類似。This method is similar to the DataGridView.OnCellMouseUp method. 在引發DataGridView.CellMouseUp事件的相同情況下呼叫它, 但實際上並不會引發事件。It is called in the same circumstances in which a DataGridView.CellMouseUp event is raised, but it does not actually raise the event.

給繼承者的注意事項

在衍生OnMouseUp(DataGridViewCellMouseEventArgs)類別中覆寫時, 請務必呼叫基類的OnMouseUp(DataGridViewCellMouseEventArgs)方法。When overriding OnMouseUp(DataGridViewCellMouseEventArgs) in a derived class, be sure to call the base class's OnMouseUp(DataGridViewCellMouseEventArgs) method.

適用於

另請參閱