BackColor Example VB

This example shows how to set the control color using the Common Color dialog.

Private Sub mnuControlColor_Click()
    On Error GoTo ErrColor    
    'Properties for the Common color dialog
    CommonDialog1.CancelError = True
    CommonDialog1.Flags = cdlCCRGBInit Or cdlCCPreventFullOpen
    CommonDialog1.ShowColor
    ImgThumbnail1.BackColor = CommonDialog1.Color
    Exit Sub
ErrColor:
    MsgBox Err.Description, , "Set Colors"
    Exit Sub
End Sub