DataGrid.OnMouseDown メソッド
アセンブリ: System.Windows.Forms (system.windows.forms.dll 内)

Protected Overrides Sub OnMouseDown ( _ e As MouseEventArgs _ )
Dim e As MouseEventArgs Me.OnMouseDown(e)
protected override void OnMouseDown ( MouseEventArgs e )
protected void OnMouseDown ( MouseEventArgs e )
protected override function OnMouseDown ( e : MouseEventArgs )
- e
OnMouseDown イベントに関するデータを格納する MouseEventArgs。

イベントが発生すると、デリゲートを使用してイベント ハンドラが呼び出されます。概要については、「イベントの発生」を参照してください。
継承時の注意 派生クラスで OnMouseDown をオーバーライドする場合は、基本クラスの OnMouseDown メソッドを呼び出してください。
Public Class MyDataGrid Inherits DataGrid ' Override the OnMouseDown event to select the whole row ' when the user clicks anywhere on a row. Protected Overrides Sub OnMouseDown(ByVal e As MouseEventArgs) ' Get the HitTestInfo to return the row and pass ' that value to the IsSelected property of the DataGrid. Dim hit As DataGrid.HitTestInfo = Me.HitTest(e.X, e.Y) If hit.Row < 0 Then Return End If If IsSelected(hit.Row) Then UnSelect(hit.Row) Else [Select](hit.Row) End If End Sub End Class
public class MyDataGrid : DataGrid { // Override the OnMouseDown event to select the whole row // when the user clicks anywhere on a row. protected override void OnMouseDown(MouseEventArgs e) { // Get the HitTestInfo to return the row and pass // that value to the IsSelected property of the DataGrid. DataGrid.HitTestInfo hit = this.HitTest(e.X, e.Y); if (hit.Row < 0) return; if (this.IsSelected(hit.Row)) UnSelect(hit.Row); else Select(hit.Row); } }
public ref class MyDataGrid: public DataGrid { protected: // Override the OnMouseDown event to select the whole row // when the user clicks anywhere on a row. virtual void OnMouseDown( MouseEventArgs^ e ) override { // Get the HitTestInfo to return the row and pass // that value to the IsSelected property of the DataGrid. DataGrid::HitTestInfo ^ hit = this->HitTest( e->X, e->Y ); if ( hit->Row < 0 ) return; if ( this->IsSelected( hit->Row ) ) UnSelect( hit->Row ); else Select(hit->Row); } };
public class MyDataGrid extends DataGrid { // Override the OnMouseDown event to select the whole row // when the user clicks anywhere on a row. protected void OnMouseDown(MouseEventArgs e) { // Get the HitTestInfo to return the row and pass // that value to the IsSelected property of the DataGrid. DataGrid.HitTestInfo hit = this.HitTest(e.get_X(), e.get_Y()); if (hit.get_Row() < 0) { return; } if (this.IsSelected(hit.get_Row())) { UnSelect(hit.get_Row()); } else { Select(hit.get_Row()); } } //OnMouseDown } //MyDataGrid

Windows 98, Windows 2000 SP4, Windows CE, Windows Millennium Edition, Windows Mobile for Pocket PC, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition
開発プラットフォームの中には、.NET Framework によってサポートされていないバージョンがあります。サポートされているバージョンについては、「システム要件」を参照してください。


Weblioに収録されているすべての辞書からDataGrid.OnMouseDown メソッドを検索する場合は、下記のリンクをクリックしてください。

- DataGrid.OnMouseDown メソッドのページへのリンク