Private Sub DataGridView1_CellClick(sender As Object, e As DataGridViewCellEventArgs) Handles DataGridView1.CellClick Dim dgv = DirectCast(sender, DataGridView) If e.ColumnIndex = -1 Then MessageBox.Show($"{e.RowIndex}行目の Header Cell Click") End If End Sub