Simulate color picker

Hi, I need help

I'm trying to simulate the color picker, but I was not able to give the colors to the items in the list.

I've this:

This is my code:

Private Sub UserForm_Initialize()

PaletteList.Clear
ColorList.Clear

Dim CSPalette As Palette
Dim CSColor As Color
Dim NColor As String

For Each CSPalette In Application.Palettes
PaletteList.AddItem CSPalette.Name
Next CSPalette

For Each CSColor In Palettes("Paleta RGB predeterminada").Colors
NColor = CSColor.Name
ColorList.AddItem NColor
Next

End Sub

thanks..

Parents
  • Former Member
    Former Member over 7 years ago
    You need implement a custom draw mode in your combobox, check this

    https://msdn.microsoft.com/en-us/library/system.windows.forms.combobox.drawmode%28v=vs.110%29.aspx?cs-save-lang=1&cs-lang=vb&f=255&MSPPError=-2147217396#code-snippet-2
Reply Children
No Data