DataGridViewCellEventArgs クラス
アセンブリ: System.Windows.Forms (system.windows.forms.dll 内)


DataGridViewCellEventArgs クラスでは、次の DataGridView イベント向けのデータが提供されます。
-
CellClick
-
CellContentClick
-
CellContextMenuStripChanged
-
CellEndEdit
-
CellEnter
-
CellErrorTextChanged
-
CellLeave
-
CellMouseEnter
-
CellMouseLeave
-
CellStyleChanged
-
CellToolTipTextChanged
-
CellValidated
-
CellValueChanged
-
RowEnter
-
RowLeave
-
RowValidated

CellMouseEnter イベント ハンドラと CellMouseLeave イベント ハンドラを使用して、セルをクリックできるかどうかを確認するコード例を次に示します。この例で ToolTipText プロパティの各値を更新して、現在のイメージのレイアウトをアドバタイズします。ここに示すコードは、「方法 : Windows フォーム DataGridView コントロールのイメージ列を操作する」に示すコードの一部です。
Private Sub dataGridView1_CellMouseEnter(ByVal sender As Object, _ ByVal e As DataGridViewCellEventArgs) _ Handles dataGridView1.CellMouseEnter Dim markingUnderMouse As Bitmap = _ CType(dataGridView1.Rows(e.RowIndex). _ Cells(e.ColumnIndex).Value, Bitmap) If markingUnderMouse Is blank Then dataGridView1.Cursor = Cursors.Default ElseIf markingUnderMouse Is o OrElse markingUnderMouse Is x Then dataGridView1.Cursor = Cursors.No ToolTip(e) End If End Sub Private Sub ToolTip( _ ByVal e As DataGridViewCellEventArgs) Dim cell As DataGridViewImageCell = _ CType(dataGridView1.Rows(e.RowIndex). _ Cells(e.ColumnIndex), DataGridViewImageCell) Dim imageColumn As DataGridViewImageColumn = _ CType(dataGridView1.Columns(cell.ColumnIndex), _ DataGridViewImageColumn) cell.ToolTipText = imageColumn.Description End Sub Private Sub dataGridView1_CellMouseLeave(ByVal sender As Object, _ ByVal e As DataGridViewCellEventArgs) _ Handles dataGridView1.CellMouseLeave dataGridView1.Cursor = Cursors.Default End Sub
private void dataGridView1_CellMouseEnter(object sender, DataGridViewCellEventArgs e) { Bitmap markingUnderMouse = (Bitmap)dataGridView1. Rows[e.RowIndex]. Cells[e.ColumnIndex].Value; if (markingUnderMouse == blank) { dataGridView1.Cursor = Cursors.Default; } else if (markingUnderMouse == o || markingUnderMouse == x) { dataGridView1.Cursor = Cursors.No; ToolTip(e, true); } } private void ToolTip(DataGridViewCellEventArgs e, bool showTip) { DataGridViewImageCell cell = (DataGridViewImageCell) dataGridView1 .Rows[e.RowIndex].Cells[e.ColumnIndex]; DataGridViewImageColumn imageColumn = (DataGridViewImageColumn) dataGridView1.Columns[cell.ColumnIndex]; if (showTip) cell.ToolTipText = imageColumn.Description; else { cell.ToolTipText = String.Empty; } } private void dataGridView1_CellMouseLeave(object sender, DataGridViewCellEventArgs e) { ToolTip(e, false); dataGridView1.Cursor = Cursors.Default; }

System.EventArgs
System.Windows.Forms.DataGridViewCellEventArgs
System.Windows.Forms.DataGridViewCellContextMenuStripNeededEventArgs
System.Windows.Forms.DataGridViewCellErrorTextNeededEventArgs
System.Windows.Forms.DataGridViewCellToolTipTextNeededEventArgs


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


DataGridViewCellEventArgs メンバ
System.Windows.Forms 名前空間
DataGridView クラス
DataGridViewCellEventHandler
DataGridViewCellEventArgs コンストラクタ
アセンブリ: System.Windows.Forms (system.windows.forms.dll 内)

Dim columnIndex As Integer Dim rowIndex As Integer Dim instance As New DataGridViewCellEventArgs(columnIndex, rowIndex)


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


DataGridViewCellEventArgs プロパティ


関連項目
DataGridViewCellEventArgs クラスSystem.Windows.Forms 名前空間
DataGridView クラス
DataGridViewCellEventHandler
DataGridViewCellEventArgs メソッド

名前 | 説明 | |
---|---|---|
![]() | Equals | オーバーロードされます。 2 つの Object インスタンスが等しいかどうかを判断します。 ( Object から継承されます。) |
![]() | GetHashCode | 特定の型のハッシュ関数として機能します。GetHashCode は、ハッシュ アルゴリズムや、ハッシュ テーブルのようなデータ構造での使用に適しています。 ( Object から継承されます。) |
![]() | GetType | 現在のインスタンスの Type を取得します。 ( Object から継承されます。) |
![]() | ReferenceEquals | 指定した複数の Object インスタンスが同一かどうかを判断します。 ( Object から継承されます。) |
![]() | ToString | 現在の Object を表す String を返します。 ( Object から継承されます。) |

名前 | 説明 | |
---|---|---|
![]() | Finalize | Object がガベージ コレクションにより収集される前に、その Object がリソースを解放し、その他のクリーンアップ操作を実行できるようにします。 ( Object から継承されます。) |
![]() | MemberwiseClone | 現在の Object の簡易コピーを作成します。 ( Object から継承されます。) |

関連項目
DataGridViewCellEventArgs クラスSystem.Windows.Forms 名前空間
DataGridView クラス
DataGridViewCellEventHandler
DataGridViewCellEventArgs メンバ
セルと行の操作に関連する DataGridView イベント向けのデータを提供します。
DataGridViewCellEventArgs データ型で公開されるメンバを以下の表に示します。



名前 | 説明 | |
---|---|---|
![]() | Equals | オーバーロードされます。 2 つの Object インスタンスが等しいかどうかを判断します。 (Object から継承されます。) |
![]() | GetHashCode | 特定の型のハッシュ関数として機能します。GetHashCode は、ハッシュ アルゴリズムや、ハッシュ テーブルのようなデータ構造での使用に適しています。 (Object から継承されます。) |
![]() | GetType | 現在のインスタンスの Type を取得します。 (Object から継承されます。) |
![]() | ReferenceEquals | 指定した複数の Object インスタンスが同一かどうかを判断します。 (Object から継承されます。) |
![]() | ToString | 現在の Object を表す String を返します。 (Object から継承されます。) |

名前 | 説明 | |
---|---|---|
![]() | Finalize | Object がガベージ コレクションにより収集される前に、その Object がリソースを解放し、その他のクリーンアップ操作を実行できるようにします。 (Object から継承されます。) |
![]() | MemberwiseClone | 現在の Object の簡易コピーを作成します。 (Object から継承されます。) |

関連項目
DataGridViewCellEventArgs クラスSystem.Windows.Forms 名前空間
DataGridView クラス
DataGridViewCellEventHandler
Weblioに収録されているすべての辞書からDataGridViewCellEventArgsを検索する場合は、下記のリンクをクリックしてください。

- DataGridViewCellEventArgsのページへのリンク