Advertisement
qiangqiang101

DataGridView1

Mar 27th, 2019
178
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
VB.NET 0.52 KB | None | 0 0
  1. Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
  2.         For Each tb In Controls.OfType(Of TextBox)()
  3.             DataGridView1.Rows.Add(tb.Text)
  4.         Next
  5.     End Sub
  6.  
  7.     Private Sub Button2_Click(sender As Object, e As EventArgs) Handles Button2.Click
  8.         Dim tbs As New List(Of TextBox) From {TextBox1, TextBox2, TextBox3, TextBox4, TextBox5, TextBox6, TextBox7, TextBox8}
  9.         For Each tb As TextBox In tbs
  10.             DataGridView1.Rows.Add(tb.Text)
  11.         Next
  12.     End Sub
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement