Advertisement
Guest User

VB Text Boxes to Array

a guest
Feb 21st, 2013
37
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
VB.NET 0.57 KB | None | 0 0
  1. Public Class Form1
  2.  
  3.     Dim textBoxCount As Integer = 5
  4.     Dim array(textBoxCount) As String
  5.  
  6.     Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
  7.         Dim tb As Control
  8.         For index = 1 To textBoxCount
  9.             tb = Me.Controls.Find("textBox" + index.ToString, True)(0)
  10.             array(index) = tb.Text
  11.         Next
  12.  
  13.         For index = 1 To textBoxCount
  14.             RichTextBox1.AppendText(array(index))
  15.             RichTextBox1.AppendText(vbNewLine)
  16.         Next
  17.  
  18.     End Sub
  19. End Class
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement