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

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

DataGridView.OnMouseClick メソッド

メモ : このメソッドは、.NET Framework version 2.0新しく追加されたものです。

MouseClick イベント発生させます

名前空間: System.Windows.Forms
アセンブリ: System.Windows.Forms (system.windows.forms.dll 内)
構文構文

Protected Overrides Sub
 OnMouseClick ( _
    e As MouseEventArgs _
)
Dim e As MouseEventArgs

Me.OnMouseClick(e)
protected override void OnMouseClick (
    MouseEventArgs e
)
protected:
virtual void OnMouseClick (
    MouseEventArgs^ e
) override
protected void OnMouseClick (
    MouseEventArgs e
)
protected override function OnMouseClick (
    e : MouseEventArgs
)

パラメータ

e

イベント データ格納している MouseEventArgs。

例外例外
例外種類条件

Exception

このコントロールは、フォーカス受け取ったときに編集モード移行するように設定されていますが、編集するセルの値を初期化できませんでした。DataError イベントハンドラ存在しないか、ハンドラによって DataGridViewDataErrorEventArgs.ThrowException プロパティtrue設定されています。例外オブジェクト通常、FormatException 型にキャストできます

解説解説
使用例使用例

このメソッド使用方法コード例次に示します

' Override OnMouseClick in a class derived from DataGridViewCell to
 
' enter edit mode when the user clicks the cell. 
Protected Overrides Sub
 OnMouseClick( _
    ByVal e As DataGridViewCellMouseEventArgs)

    If MyBase.DataGridView IsNot Nothing
 Then

        Dim point1 As Point = MyBase.DataGridView.CurrentCellAddress
        If point1.X = e.ColumnIndex And _
            point1.Y = e.RowIndex And _
            e.Button = MouseButtons.Left And _
            Not MyBase.DataGridView.EditMode
 = _
            DataGridViewEditMode.EditProgrammatically Then

            MyBase.DataGridView.BeginEdit(True)

        End If
    End If
End Sub
// Override OnMouseClick in a class derived from DataGridViewCell to
 
// enter edit mode when the user clicks the cell. 
protected override void OnMouseClick(DataGridViewCellMouseEventArgs
 e)
{
    if (base.DataGridView != null)
    {
        Point point1 = base.DataGridView.CurrentCellAddress;
        if (point1.X == e.ColumnIndex &&
            point1.Y == e.RowIndex &&
            e.Button == MouseButtons.Left &&
            base.DataGridView.EditMode !=
            DataGridViewEditMode.EditProgrammatically)
        {
            base.DataGridView.BeginEdit(true);
        }
    }
}
プラットフォームプラットフォーム
バージョン情報バージョン情報
参照参照



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

辞書ショートカット

すべての辞書の索引

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

   

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



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

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

©2024 GRAS Group, Inc.RSS