Results 1 to 2 of 2

Thread: Creating ActiveX property list dropdown

  1. #1

    Thread Starter
    Junior Member
    Join Date
    Jan 2001
    Posts
    22

    Question Creating ActiveX property list dropdown

    I am playing around with ActiveX controls and adding new properties for the control. I can add properties defined as boolean, string and integer. What I want to be able to do is add a property that appears as a selection list (dropdown list box) in the properties window when the new ActiveX control is placed on a form.

    This has got to be a piece of cake for someone. I just don't want to spend a bunch of time digging for the answer. I have a few ideas (property array? -- indexedvalue??), but don't want to spend too much time digging.

    Thanks:

  2. #2
    Hyperactive Member
    Join Date
    Apr 2002
    Location
    uk
    Posts
    327
    mmmmm chocolate cake...

    It is easy actually. All you have to do is use an Enum. I know I know, a strange new word (or maybe not). Well they work like this:
    Code:
    Enum myConstants
      Chiefy = 0
      IsAGod = 1
      Wooo = 2
    End Enum
    Simple huh?
    Then, when you're declaring your property, simply use the constant type instead of an Integer... like this:
    Code:
    Public Property Get myProp() As myConstants
    End Property
    
    Public Property Let myProp(ByVal NewProp As myConstants)
    End Property

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