Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9259557
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T12:41:10+00:00 2026-06-18T12:41:10+00:00

Im trying to write a program in VB.net for a shopping system. It will

  • 0

Im trying to write a program in VB.net for a shopping system. It will read through the database and populate the items on the form. The app displays information such as product name etc in labels, inside a scrollable panel. Im creating the objects and assigning values such as text at runtime. I’m using a loop for the code.

If i was using vb 6, i would have a control array, and use the index and my counter to display the data. Since im doing this in vb.net, i have no way to do that.. Any solutions?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-18T12:41:11+00:00Added an answer on June 18, 2026 at 12:41 pm

    VB.NET does not support control arrays, in the same sense as VB6. You can do similar things, though. For instance, if you want to handle events from multiple controls with the same method, you can do so like this:

    Private Sub MyClickHandler(sender As Object, e As EventArgs) Handles _
        Button1.Click, _
        Button2.Click, _
        Button3.Click
    
        Dim buttonThatWasClicked As Button = CType(sender, Button)
        ' Do something...
    End Sub
    

    If you want to create an array of controls that you can loop through, you can do that to, like this:

    Dim myTextBoxes() As TextBox = New TextBox() { TextBox1, TextBox2, TextBox3 }
    For i As Integer = 0 to myTextBoxes.Length - 1
        myTextBoxes(i).Text = ...
    Next
    

    Alternatively, if you name your controls consistently, you can find them by name in your form’s Controls collection. For instance, if you had three text boxes named TextBox1, TextBox2, and TextBox3, you could loop through them like this:

    For i As Integer = 1 to 3
        Dim t As TextBox = CType(Me.Controls("TextBox" & i.ToString()), TextBox)
        t.Text = ...
    Next
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am trying to write a program that will prompt you to enter someone's
I am trying to write a program that displays the integers between 1 and
I am trying to write a java program that will automatically download and name
This is the general goal I am trying to achieve: My VB.NET program will
I am trying to write a java program that will allow me to send
I am trying to write a .NET program so I can execute a Dts
I'm currently trying to write a program in VB.NET which fluidly changes the DWM
I'm trying to write Oracle SQL queries executed via a C#/ASP.NET program to insert
I am trying to write a program that will send GPS coordinates using telnet.
I am trying to write a standalone program that will be called by a

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.