如下
Public Class Form1
Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
Dim newRow As New DataGridViewRow()
Dim newRowCell As New DataGridViewTextBoxCell
newRow.Cells.Add(newRowCell)
newRowCell = New DataGridViewTextBoxCell
newRowCell.Value = Me.TextBox1.Text
newRow.Cells.Add(newRowCell)
DataGridView1.Rows.Add(newRowCell)
End Sub
End Class
运行图如下