MsgBox("Colonne n. " & DataGridView1.ColumnCount, MsgBoxStyle.Information, "OK") Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.Click Dim I As Integer = 1 For I = 0 To DataGridView1.ColumnCount - 1 Debug.Print(DataGridView1.Columns(I).Name) Next MsgBox("Colonne n. " & DataGridView1.ColumnCount, MsgBoxStyle.Information, "OK") End Sub |