Results 1 to 5 of 5

Thread: Activex Control ... button on a property

  1. #1

    Thread Starter
    PowerPoster Beacon's Avatar
    Join Date
    Jan 2001
    Location
    Pub Floor
    Posts
    3,188

    Activex Control ... button on a property

    Hi all,

    On a activex control in a property how do i get the button with ... on it that lets you select a path or file!

    I need it to set a path to a directory??? not a file just a directory?

    ANyone??

    thanks
    beacon

  2. #2
    Registered User Nucleus's Avatar
    Join Date
    Apr 2001
    Location
    So that's what you are up to ;)
    Posts
    2,530
    I am not sure exactly what you are doing Beacon, but try a seacrch for SHBrowseForFolder.

  3. #3
    Fanatic Member Kaverin's Avatar
    Join Date
    Oct 2000
    Posts
    930
    That button appears when you have a special type of property. As far as I know, it only appears for font and picture ones because they have special property pages and ways to allow you to choose something. For just selecting a file/path I don't think you can actually make them come up like that. If you want the buttons to appear for properties like that, you need to use something like this:
    VB Code:
    1. Public Property Get Font() As Font
    2.    Set Font = UserControl.Font
    3. End Property
    4.  
    5. Public Property Set Font(ByVal NewFont As Font)
    6.    Set UserControl.Font = NewFont
    7. End Property
    8.  
    9. Public Property Get Picture() As Picture
    10.    Set Picture = UserControl.Picture
    11. End Property
    12.  
    13. Public Property Set Picture(ByVal NewPicture As Picture)
    14.    Set UserControl.Picture = NewPicture
    15. End Property
    16.  
    17. 'this one doesn't have anything to do with the ... button, but it's how you get the color palette to appear for your control in the prop window
    18. Public Property Get Color() As OLE_COLOR
    19.    Color = UserControl.BackColor
    20. End Property
    21.  
    22. Public Property Let Color(ByVal NewColor As OLE_COLOR)
    23.    UserControl.BackColor = NewColor
    24. End Property
    Even though it looks weird because the properties have the same name as the objects involved, this is what lets the special buttons appear in the property window. When you use these types, you can get the premade windows property pages to appear inside the (Custom) part of the property list as well if you add any property pages to the control using the wizard. They're the Standard Font/Picture/Color ones.
    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

  4. #4

    Thread Starter
    PowerPoster Beacon's Avatar
    Join Date
    Jan 2001
    Location
    Pub Floor
    Posts
    3,188
    dammit!!
    How does adodc do it?
    And dao?

    Puzzling!!!

  5. #5

    Thread Starter
    PowerPoster Beacon's Avatar
    Join Date
    Jan 2001
    Location
    Pub Floor
    Posts
    3,188
    thanks anyway fellas!!

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