Results 1 to 3 of 3

Thread: Control Arrays in VB.NET - NONE!!!

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    Mar 2002
    Posts
    225

    Control Arrays in VB.NET - NONE!!!

    I have been used to creating control arrays when I want to create dynamic controls. I would create one control at design time set the index and then create new ones at runtime by incrementing the index property. I am trying to do the same thing in VB.net and am at a complete standstill.

    I know there are no control arrays in VB.net but is there anyway to achieve the same result?

    Any assistance will be welcome.

    Tesita

  2. #2
    Lively Member
    Join Date
    May 2002
    Posts
    94
    Create an array as the control and then you could add it at runtime

    Code:
        Dim xTextBox(1) As System.Windows.Forms.TextBox
        xTextBox(0) = New System.Windows.Forms.TextBox()
        xTextBox(1) = New System.Windows.Forms.TextBox()
    
        MyForm.Controls.Add(xTextBox(0))
    hope this helps

  3. #3
    Your Ad Here! Edneeis's Avatar
    Join Date
    Feb 2000
    Location
    Moreno Valley, CA (SoCal)
    Posts
    7,339
    This is a very common question, you should try searching first and you'll get a lot more answers:

    http://www.vbforums.com/search.php?s...der=descending

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width