Results 1 to 5 of 5

Thread: VB6 Collection Classes in C#

  1. #1

    Thread Starter
    Fanatic Member Bombdrop's Avatar
    Join Date
    Apr 2001
    Location
    St Helens, England, UK
    Posts
    667

    VB6 Collection Classes in C#

    Hi still getting my head round C# ( but it is great) trying to do something I use to use a lot in VB6 that being the Collection Class but have no idea how to achieve this via C# ( it does not even support the collection object unlike VB.Net)
    Any help would be appreciated

  2. #2
    Kitten CornedBee's Avatar
    Join Date
    Aug 2001
    Location
    In a microchip!
    Posts
    11,594
    System.Collections contains a few collections, though far too few to be really useful I say. Still, it's more than VB6 had.

    I think the class that most closely resembles VB6' Collection is System.Windows.Forms.Control.ControlCollection.
    All the buzzt
    CornedBee

    "Writing specifications is like writing a novel. Writing code is like writing poetry."
    - Anonymous, published by Raymond Chen

    Don't PM me with your problems, I scan most of the forums daily. If you do PM me, I will not answer your question.

  3. #3
    Frenzied Member axion_sa's Avatar
    Join Date
    Jan 2002
    Location
    Joburg, RSA
    Posts
    1,724
    Depends on how you want to do "it" - do you want to use an key, or a numeric index (Hashtable and ArrayList respectively)?

  4. #4
    New Member
    Join Date
    Jul 2011
    Posts
    6

    Re: VB6 Collection Classes in C#

    I have looked for several collection classes in C#, but none of them support the following VB Collection.Add method:

    VB:
    Collection.Add(item, value, before, after)

    The 'before' & 'after' parameters are not supported anywhere in C# collection classes like Dictionary, Hashtable, etc.

    If anyone has clue on how to support this in C#, please post some code. Much appreciated !

  5. #5
    Fanatic Member
    Join Date
    Jan 2006
    Posts
    710

    Re: VB6 Collection Classes in C#

    You can reference the Microsoft.VisualBasic assembly and then use it directly.
    However, this collection is rather eccentric compared to the standard collections in the System.Collections.Generic namespace, which most developers will recognize (List, Dictionary, etc.).
    David Anton
    Convert between VB, C#, C++, & Java
    www.tangiblesoftwaresolutions.com

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