Private Sub bt_Add_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles bt_Add.Click
Dim i As Integer = 0
For i = 0 To DataGridView1.Rows.Count - 1
If DataGridView1.Rows(i).Selected Then
Dim j As Integer = Sale.DataGridView2.Rows.Add
Vaccination.DataGridView2.Rows(j).Cells(0).Value = DataGridView1.Rows(i).Cells(0).Value
Vaccination.DataGridView2.Rows(j).Cells(1).Value = DataGridView1.Rows(i).Cells(1).Value
Vaccination.DataGridView2.Rows(j).Cells(2).Value = DataGridView1.Rows(i).Cells(2).Value
Vaccination.DataGridView2.Rows(j).Cells(3).Value = DataGridView1.Rows(i).Cells(3).Value
'Vaccination.DataGridView2.Rows(j).Cells(4).Value = DataGridView1.Rows(i).Cells(4).Value
End If
Next
Me.Close()
End Sub
Dim NewRow As DataGridViewRow = New DataGridViewRow()
Dim Cell1 As DataGridViewCell = New DataGridViewTextBoxCell()
Dim Cell2 As DataGridViewCell = New DataGridViewTextBoxCell()
Dim Cell3 As DataGridViewCell = New DataGridViewTextBoxCell()
Cell1.Value = "Cell1"
Cell2.Value = "Cell2"
Cell3.Value = "Cell3"
NewRow.Cells.Add(Cell1)
NewRow.Cells.Add(Cell2)
NewRow.Cells.Add(Cell3)
DataGridView1.Rows.Add(NewRow)
Private Sub bt_Add_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles bt_Add.Click
Dim NewRow As DataGridViewRow = New DataGridViewRow()
Dim Cell1 As DataGridViewCell = New DataGridViewTextBoxCell()
Dim Cell2 As DataGridViewCell = New DataGridViewTextBoxCell()
Dim Cell3 As DataGridViewCell = New DataGridViewTextBoxCell()
Dim Cell4 As DataGridViewCell = New DataGridViewTextBoxCell()
Dim Cell5 As DataGridViewCell = New DataGridViewTextBoxCell()
Cell1.Value = "Dog_ID"
Cell2.Value = "Dog_Name"
Cell3.Value = "Dog_Sex"
Cell4.Value = "Dog_Color"
Cell5.Value = "Dog_Status"
NewRow.Cells.Add(Cell1)
NewRow.Cells.Add(Cell2)
NewRow.Cells.Add(Cell3)
NewRow.Cells.Add(Cell4)
NewRow.Cells.Add(Cell5)
Vaccination.DataGridView2.Rows.Add(NewRow)
Public Class Form1
Private Sub Form1_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
Dim Column1 As DataGridViewTextBoxColumn = New DataGridViewTextBoxColumn()
Column1.Name = "Column1"
Column1.HeaderText = "Column1"
Dim Column2 As DataGridViewTextBoxColumn = New DataGridViewTextBoxColumn()
Column2.Name = "Column2"
Column2.HeaderText = "Column2"
DataGridView1.Columns.Add(Column1)
DataGridView1.Columns.Add(Column2)
End Sub
Private Sub AddButton_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles AddButton.Click
Dim NewRow As DataGridViewRow = New DataGridViewRow()
Dim Cell1 As DataGridViewCell = New DataGridViewTextBoxCell()
Dim Cell2 As DataGridViewCell = New DataGridViewTextBoxCell()
Cell1.Value = "Cell1"
Cell2.Value = "Cell2"
NewRow.Cells.Add(Cell1)
NewRow.Cells.Add(Cell2)
DataGridView1.Rows.Add(NewRow)
End Sub
End Class