Results 1 to 3 of 3

Thread: [RESOLVED] Combobox style for public properties

  1. #1

    Thread Starter
    Super Moderator dday9's Avatar
    Join Date
    Mar 2011
    Posts
    12,376

    Resolved [RESOLVED] Combobox style for public properties

    I'm creating a user control, and I'd like to know how do you set certain values for a property? For example, boolean values during design time gives you the dropdown with "true" or "false". More specifically I'm using the values in style from a progressbar. I don't know if I'm explaining myself correctly, so imma post a screen shot of waht I meen.
    Attachment 91265

    Hope y'all get what I'm trying to say.
    "Code is like humor. When you have to explain it, it is bad." - Cory House
    VbLessons | HtmlLessons | CssLessons | Code Tags | Sword of Fury - Jameram

  2. #2
    PowerPoster techgnome's Avatar
    Join Date
    May 2002
    Posts
    34,687

    Re: Combobox style for public properties

    Properties that have the dropdown like that are enum types...where there is a defined list of values to select from.

    For example, the style of a progress bar is defined "As ProgrssBarStyle" (I'm guessing at the name really, but this illustrates the point) ... which is defined as such:
    Code:
    Public Enum ProgressBarStyle
      Blocks = 0
      Continous
      Marquee
    End Enum
    And then the property:
    Code:
    Private _Style as ProgressBarStyle
    
    Public Property Set Style(Value as ProgrssBarStyle)
      _Style = Value
    End property
    
    Public Property Get Style as ProgressBarStyle
      return _Style
    End Property
    -tg
    * I don't respond to private (PM) requests for help. It's not conducive to the general learning of others.*
    * I also don't respond to friend requests. Save a few bits and don't bother. I'll just end up rejecting anyways.*
    * How to get EFFECTIVE help: The Hitchhiker's Guide to Getting Help at VBF - Removing eels from your hovercraft *
    * How to Use Parameters * Create Disconnected ADO Recordset Clones * Set your VB6 ActiveX Compatibility * Get rid of those pesky VB Line Numbers * I swear I saved my data, where'd it run off to??? *

  3. #3

    Thread Starter
    Super Moderator dday9's Avatar
    Join Date
    Mar 2011
    Posts
    12,376

    Re: Combobox style for public properties

    A ha! Thanks tg. I've never use Enum's before :P
    "Code is like humor. When you have to explain it, it is bad." - Cory House
    VbLessons | HtmlLessons | CssLessons | Code Tags | Sword of Fury - Jameram

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