Yahoo Answers is shutting down on May 4th, 2021 (Eastern Time) and beginning April 20th, 2021 (Eastern Time) the Yahoo Answers website will be in read-only mode. There will be no changes to other Yahoo properties or services, or your Yahoo account. You can find more information about the Yahoo Answers shutdown and how to download your data on this help page.

Text boxes in vb.net?

Say I have to add information from multiple text boxes. Is the a way I could just say add all the text boxes from my form? It would make this program much easier!

2 Answers

Relevance
  • 9 years ago
    Favorite Answer

    You only asked half a question really. You didn't say what you wanted to add the information to which would have helped.

    To read the information from every textbox on the form you can use a for/next loop

    For Each tb As Windows.Forms.TextBox In Me.Controls.OfType(Of TextBox)()

    tb.Text = "0" ' replace this with code to do whatever you need

    Next

    Source(s): VB.NET Programmer
  • 4 years ago

    i'm uncertain while you're applying .internet a million.a million or 2.0, so i will write for a million.a million. Dim carry As ArrayList = New ArrayList 'get the Tag values for each administration for each administration As administration In groupBox1.Controls If (administration is TextBox) Then carry.upload(administration.Tag) end If next 'Then control the non everlasting array for each obj As merchandise In carry 'Do artwork with the products in carry 'e.g. keep their string representations right into a ListBox listBox1.products.upload(obj.ToString) next of direction, you are able to merely without delay artwork with the administration array and ditch the greater beneficial array.

Still have questions? Get your answers by asking now.