by Tom de Lange (5 Submissions)
Category: Custom Controls/Forms/Menus
Compatability: Visual Basic 3.0
Difficulty: Intermediate
Date Added: Wed 3rd February 2021
Rating: (9 Votes)
A popup color selector active-x control, similar to a combobox, featuring 12 different palettes, and 2 color selection events: Click() and Change(). The popup window can be disabled, in which case the popup()event may be used to substitute your own color selection code, or access to the common windows dialog. Hue selection is done
through mouse hovering using custom timer class. Credits to various VBC contributors as listed in the text file. Uses 12 API functions. Full source included - well commented.
V1.1 now includes hWnd property. (Thanks Ross McCawley!)
API DeclarationsNo need to copy!
---------------------------------
MoveToEx Lib "gdi32"
LineTo Lib "gdi32"
DrawEdge Lib "user32"
PtInRect Lib "user32"
SetParent Lib "user32"
SetWindowLong Lib "user32"
SetCapture Lib "user32"
GetCapture Lib "user32"
ReleaseCapture Lib "user32"
GetWindowRect Lib "user32"
GetClientRect Lib "user32"
GetFocus Lib "user32"