dcsimg
Results 1 to 14 of 14

Thread: Color ComboBox

Threaded View

  1. #1

    Thread Starter
    PowerPoster JuggaloBrotha's Avatar
    Join Date
    Sep 2005
    Location
    Lansing, MI; USA
    Posts
    4,283

    Color ComboBox

    Here's a ComboBox that displays Colors from the Color class, it even includes a square in the drop down showing the color as well as the name.

    See post #5 and #6 for the control's code.

    Here some examples of using it:
    Code:
        'Use defaults
        Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
            Dim ccb As New ColorComboBox()
            ccb.Location = New Point(5I, 5I)
            Me.Controls.Add(ccb)
        End Sub
    
        'Includes SystemColors
        Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
            Dim ccb As New ColorComboBox(False, True)
            ccb.Location = New Point(5I, 5I)
            Me.Controls.Add(ccb)
        End Sub
    
        'Use custom list of colors
        Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
            Dim ccb As New ColorComboBox(New Color() {Color.Black, Color.White, Color.Blue, Color.Red})
            ccb.Location = New Point(5I, 5I)
            Me.Controls.Add(ccb)
        End Sub
    Last edited by JuggaloBrotha; Sep 23rd, 2008 at 12:55 PM.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Featured


Click Here to Expand Forum to Full Width