Public Class Form4
    Dim dt As New DataTable
    Private Sub Form4_Load(sender As System.Object, e As System.EventArgs) Handles MyBase.Load
        dt.Columns.Add("Value")
    End Sub

    Private Sub Button1_Click(sender As System.Object, e As System.EventArgs) Handles Button1.Click

        dt.Rows.Add(Form3.TextBox1.Text)
        DataGridView1.DataSource = dt
    End Sub
End Class

Hope the above code will help u.!

thanks , but i will explain my problem..I have a form that contains a textbox and a button "Register" and in the other form there is a datagridview, I want that when I click on the "Register" button, the values of textbox will automatically appear in the datagridview I tried several solutions but it does not work, I use visual studio 2013 software with vb code, can you help me please

For the following example create a new project with two forms named form1 and form2. Form1 has a button and two textboxes with the default names. Form2 has a DataGridView with the given name.

Public Class Form1

    Private Sub Button1_Click(sender As System.Object, e As System.EventArgs) Handles Button1.Click

        Dim row As New DataGridViewRow()

        row.Cells.AddRange({New DataGridViewTextBoxCell(), New DataGridViewTextBoxCell()})
        row.Cells(0).Value = TextBox1.Text
        row.Cells(1).Value = TextBox2.Text
        Form2.DataGridView1.Rows.Add(row)

    End Sub

    Private Sub Form1_Load(sender As System.Object, e As System.EventArgs) Handles MyBase.Load
        Form2.Show()
    End Sub

End Class
This question has already been answered. Start a new discussion instead.