DataGrid.OnMouseDown メソッドとは? わかりやすく解説

Weblio 辞書 > コンピュータ > .NET Framework クラス ライブラリ リファレンス > DataGrid.OnMouseDown メソッドの意味・解説 

DataGrid.OnMouseDown メソッド

MouseDown イベント発生させます

名前空間: System.Windows.Forms
アセンブリ: 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:
virtual void OnMouseDown (
    MouseEventArgs^ e
) override
protected void OnMouseDown (
    MouseEventArgs e
)

パラメータ

e

OnMouseDown イベントに関するデータ格納する MouseEventArgs。

解説解説
使用例使用例
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 
プラットフォームプラットフォーム
バージョン情報バージョン情報
参照参照



英和和英テキスト翻訳>> Weblio翻訳
英語⇒日本語日本語⇒英語
  

辞書ショートカット

すべての辞書の索引

DataGrid.OnMouseDown メソッドのお隣キーワード
検索ランキング

   

英語⇒日本語
日本語⇒英語
   



DataGrid.OnMouseDown メソッドのページの著作権
Weblio 辞書 情報提供元は 参加元一覧 にて確認できます。

   
日本マイクロソフト株式会社日本マイクロソフト株式会社
© 2024 Microsoft.All rights reserved.

©2024 GRAS Group, Inc.RSS