Results 1 to 3 of 3

Thread: Requested Tip - Control Arrays?!

  1. #1

    Thread Starter
    Banished Cander's Avatar
    Join Date
    Dec 2000
    Location
    Why do you care?
    Posts
    6,913

    Requested Tip - Control Arrays?!

    Ok Im going to nip this one in the bud. This is asked alot. Yes Control Arrays are still there in a sense. You just dont have the Index property anymore. You can add a control to a regular array or arraylist.

    BUT>>>>>>>>>

    Here is the problem. Dont do it. Why? Becuase when a control is created, it is added to a Collection of controls. You can enumerate through the controls in this collection to do what you need or add to it dynamically. So why waste resources on yet another 'collection'(the array) to do things the old way. It is best in thethis regard to grin and bare it, and learn how to work with collections and control collections.

    You also have a groupbox control thats you can use as a container for controls you may want to seperate from the main controls collection.

    Now I dont have any code as of yet because I just havent had to do any of this yet, but I have been reading up on it. Anyone else who wants to shed some more light here is welcome to.
    Stack Overflow
    See the features of Visual Studio 2010 and C# 4.0: The 10-4 show on Channel9

  2. #2
    Lively Member
    Join Date
    Mar 2002
    Location
    WestCoast - Cali
    Posts
    116
    I've posted this before but it might be of interest to anyone who is reading this post to begin with.

    http://www.developerfusion.com/show/2499/

  3. #3
    Lively Member ac11965's Avatar
    Join Date
    May 2000
    Location
    East London, South Africa
    Posts
    69
    i totally agree.

    i have been playing around with creating controls dynamically and then running thru them in the collections.
    you can event create events for your newly created controls...

    it's actually not so difficult and ms has given a lot of documentation and help on this.

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