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 7500257
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T20:07:01+00:00 2026-05-29T20:07:01+00:00

if i generate a label dynamically i can change the text as followed, variable

  • 0

if i generate a label dynamically i can change the text as followed, variable is a string:

Form.Controls(variable).text = "test"

I now have a sub that will create some and will get some information out of arrays. I have a lot of them. I only want the function for tat specific array. I do not want a case or if. Thats why i was wondering if i can use a variable in the array variable. Sounds strange, here is what i mean:

Public TestArray() as String

Public Sub BuildStructure(ByVal Shelf As String)    
    Dim XMax as Integer
    XMax = TestArray.GetLength(1)
End Sub

But instead of TestArray beeing hardcoded i want it to be replaced with Shelf. So whatever gets send into the sub will change the array that i’m using.

Is that possible some how or is the way totally wrong?

Thanks

  • 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-05-29T20:07:02+00:00Added an answer on May 29, 2026 at 8:07 pm

    You can use an arraylist object that you can easily add and remove items from at runtime. Here’s the MSDN page: http://msdn.microsoft.com/en-us/library/7x4b0a97.aspx

    Public TestArray As New ArrayList
    
    Public Sub BuildStructure(ByVal Shelf As String)        
        TestArray.Add(Shelf)
    End Sub
    

    If you need an array, you can always call the .ToArray method on the ArrayList

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have several checboxes in my html, are generate dynamically so i can predict
How can I set label's border which is dynamically generated (Not from Interface Builder)?
In Clearcase I can generate a label for a given set of files and
In my MFC project, I want to generate the labels dynamically. Eg: I have
I have a form that is dynamically generated, and has dynamically generated id's (and
How do I generate a label ID dynamically in ASP.NET MVC? I was able
I have a form with select fields dynamically generated and with the options taken
I have a form with select fields dynamically generated and with the options taken
I have a radio button that is generated dynamically on the page. I change
I have created pictureboxes dynamically in windows forms Application... its working well... now i

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.