Results 1 to 6 of 6

Thread: list functions of Class

  1. #1

    Thread Starter
    Junior Member
    Join Date
    Mar 2002
    Location
    Mostar, Bosnia and Hercegovina
    Posts
    16

    list functions of Class

    I have a class module with 6 let/get properties.
    Can I list a names of that properties at run time with my program? I need a values of properties of some class at run time

    For example:
    for i = 1 to numberofproperties
    x(i) = myClass...value of i property
    next i

  2. #2
    jim mcnamara
    Guest
    If the class module is created in VB and is a separate piece of code (dll, OCx, etc), then the

    Class.Properties

    collection enumerates the properties.

  3. #3

    Thread Starter
    Junior Member
    Join Date
    Mar 2002
    Location
    Mostar, Bosnia and Hercegovina
    Posts
    16
    But, I need to list properties of some class.

    I dont know the name of the property.

  4. #4
    Your Ad Here! Edneeis's Avatar
    Join Date
    Feb 2000
    Location
    Moreno Valley, CA (SoCal)
    Posts
    7,339
    Sorry but I don't think classes have any Properties collection to enum (I could be wrong). Unless you set up your props in a way to enum them.

  5. #5

    Thread Starter
    Junior Member
    Join Date
    Mar 2002
    Location
    Mostar, Bosnia and Hercegovina
    Posts
    16
    There must be a way to do that.
    When we include some dll or ocx in VB at design time, VB Editor "read" all properties and write that on Properties window, or when we write a code and write a "." there is shown list of properties and methods of that class.
    Is it right?
    But I dont know how

  6. #6
    Your Ad Here! Edneeis's Avatar
    Join Date
    Feb 2000
    Location
    Moreno Valley, CA (SoCal)
    Posts
    7,339
    You can get that information by using the TypeLib Information ovject but that does mean there is a way to loop through like:
    MyObj.Properties(1).value=?

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