Results 1 to 5 of 5

Thread: ActiveX Control Properties

  1. #1

    Thread Starter
    Frenzied Member numtel's Avatar
    Join Date
    Apr 2000
    Location
    CA
    Posts
    1,163

    ActiveX Control Properties

    I used the wizard to add properties to my control but when when I put them in I don't get the drop-down color menu or the alignment choices dropdown. How can I fix this?

  2. #2
    Does the Alignment thing work if the property is an Enum?

  3. #3

    Thread Starter
    Frenzied Member numtel's Avatar
    Join Date
    Apr 2000
    Location
    CA
    Posts
    1,163
    i've got the stuff in an enum and tryed making the variable in the property the enum but that didn't work so i tryed doing it to the whole property, that still didn't work. what should i do?

  4. #4
    Fanatic Member Kaverin's Avatar
    Join Date
    Oct 2000
    Posts
    930
    When I have this in a usercontrol, the dropdown list with 0-a 1-b etc. will appear in the property window.
    VB Code:
    1. Public Enum X
    2.    a
    3.    b
    4.    c
    5.    d
    6. End Enum
    7. Private Y As X
    8. Public Property Get Z() As X
    9.    Z = Y
    10. End Property
    11. Public Property Let Z(ByVal NewZ As X)
    12.    Y = NewZ
    13. End Property
    Is that not working for you, or was yours different? To get the color palette to appear, you have to have something similar to this:
    VB Code:
    1. Public Property Get Z() As OLE_COLOR
    2.    Z = somelongvar
    3. End Property
    4. Public Property Let Z(ByVal NewZ As OLE_COLOR)
    5.    somelongvar = NewZ
    6. End Property
    The important part is the type, which is OLE_COLOR. It's actually a long, but when named like that, the palette will appear in the property window. The standard dialogs will appear in the property window for font and picture if you use the types "Font" and "Picture" specifically like OLE_COLOR was used above. They're both objects, but the property can use ByVal on them, and I've never seen it done otherwise. If you use ByRef or leave out ByVal, you may get some weird effect(s) since a separate copy of the object isn't being made.
    I'm baaaack...
    VB5 Professional Edition, VC++ 6
    Using a 1 gHz Thunderbird, 256 mb RAM, 40 gb HD system with Win98se

    I feel special because I finally figured out how to loop midis: Post link
    I'm a fanatic too

  5. #5

    Thread Starter
    Frenzied Member numtel's Avatar
    Join Date
    Apr 2000
    Location
    CA
    Posts
    1,163
    thanx dude works great now

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