Results 1 to 4 of 4

Thread: Subclassing Listview control

  1. #1

    Thread Starter
    New Member
    Join Date
    Nov 2002
    Posts
    8

    Subclassing Listview control

    Hi,
    I'm writing a project in VB6 and would like to add to the element Item As MSComctlLib.ListItem new properties and methods?
    Is it possible?
    My purpose is to associate the each ListItem some additional information.
    Any help will be greatly appreciated.

  2. #2
    The Devil crptcblade's Avatar
    Join Date
    Aug 2000
    Location
    Quetzalshacatenango
    Posts
    9,091
    I don't think you can. But depending on what you are trying to accomplish, you could probably use each ListItem's Tag property to hold an object that contains the additional info. The Tag is a Variant, I think.

    Just add/edit the extra info as you add/interact the listitems.

    Laugh, and the world laughs with you. Cry, and you just water down your vodka.


    Take credit, not responsibility

  3. #3
    Frenzied Member maged's Avatar
    Join Date
    Nov 2002
    Location
    Egypt
    Posts
    1,040
    if i am understanding the problem, you are using a standard listbox and you want to link every item in the list with other items,

    the solution presented by MR. crptcblade is good if you want to link the full control with something else, but if you want to link each item in the list with other sub items , i think you should use another control called (listview) , Check it in msdn help to c if it fits your needs.

    hope i could help

  4. #4

    Thread Starter
    New Member
    Join Date
    Nov 2002
    Posts
    8

    Re: Subclassing Listview control

    Thanks. I think that the good solution is to use the Tag object of the ListItem object (of the Listview control).
    So, can I also associate to the ListItem.Tag attribute a class so that I can set and get its properties and call its methods?
    Thanks again.

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