Results 1 to 5 of 5

Thread: How to simulate a control array in VB.NET?

  1. #1

    Thread Starter
    Member
    Join Date
    Nov 2002
    Location
    Netherlands
    Posts
    32

    Question How to simulate a control array in VB.NET?

    Can anyone help me with this:

    In VB.NET, control arrays don't exist anymore. Microsoft says that it is unnecessary to have control arrays because of the "one-event-for-multiple-controls" thing.
    But now I would like to programatically load/add a control. Like this in VB6:
    Code:
    Load cmdMake(2)
    What is the syntax of this code in VB.NET??

    Thanks in advance.

  2. #2
    Fanatic Member Mr.No's Avatar
    Join Date
    Sep 2002
    Location
    Mauritius
    Posts
    651
    M@RTYN

    Try this.
    VB Code:
    1. Dim mytext As New TextBox()
    2.   Dim mypos As New Point(10, 20)
    3.   mytext.Location = mypos
    4.   Me.Controls.Add(mytext)
    Using VB.NET 2003/.NET 1.1/C# 2.0
    http://del.icio.us/rajoo
    Blow your mind, smoke gunpowder
    Ashes to ashes, dust to dust
    If God won't have you, the devil will. - Author unknown
    Don't follow me, I'm lost too ...

  3. #3

    Thread Starter
    Member
    Join Date
    Nov 2002
    Location
    Netherlands
    Posts
    32
    OK, thanx! That works!

  4. #4
    yay gay PT Exorcist's Avatar
    Join Date
    Apr 2002
    Location
    . . . my reason of shame
    Posts
    2,729
    u can add events and that things too from there
    \m/\m/

  5. #5

    Thread Starter
    Member
    Join Date
    Nov 2002
    Location
    Netherlands
    Posts
    32
    Can you tell me how I can handle these events?

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