Unicode Controls & Classes for VB6 - Version 4

clsCommDialogs.ShowColor Function

Displays the color chooser dialog

Syntax
Public Function ShowColor (ByVal hwndParent As Long, _
Optional ByRef lStartColor As Long = -1&) As Long
Parameters
Parameter Description
ByVal hwndParent As Long Parent window handle, pass 0& if there is no parent form
Optional ByRef lStartColor As Long = -1& Start color (optional)
Remarks
Returns the chosen color
You can set or retrieve custom colors by using [SetCustomColor] and [GetCustomColor]

Draw a ctlColorWL on a form then paste this code inside
Private Sub Form_Load()
Dim ocd As New clsCommDialogs
ocd.SetCustomColor 0, vbYellow
ocd.SetCustomColor 15, vbGreen
ctlColorXP1.Color = ocd.ShowColor(Me.hWnd, vbRed)
End Sub