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




Reply With Quote