Full Version: Colour picker
UtterAccess Forums > Microsoft® Access > Access Forms
Hello all,
I'm looking for a good colour picker form. Something that either resembles the colour picker you'd find in paint (with the selected boxes containing colours), or the spectrum style one, where you pick a point in a large multicoloured box and it gives you the colour.
The question is : does anyone know if this has been built before, and where I can find it? I tried one of the activeX controls, ColorBVR Class, but, apparently, its not installed (and I dont have access to install it - so if that does the trick, I'll need something else)
So, does anyone have any suggestions, or do I tack it on to the long list of things i have to do?
Thanks again,
There is this in the Code Archives: Color Combination Viewer
And this at The Access Web Calling Windows Choose Color Dialog
hope this helps
This is the Standard solution, but I find it looks a bit funny because it seems to size the window small for the controls contained within.
Candace Tripp has an undocumented example on her site that is essentially identical but looks better (but with the usual undocumented caveats), however my internet is misbehaving today and I can't find the link.
I dug out my adaptation of Candace's function:
Private Declare Sub AccChooseColor _
                Lib "msaccess.exe" _
              Alias "#53" (ByVal hwnd As Long, RGB As Long)
' Function  : fChooseColour
' Author    : dm - reworked from Candace Tripp
' Parameters: lCurrentColor - long integer value of intial colr
' Returns   : long integer color value or -1 if cancelled
' Comments  : invokes the windows color chooser dialog
'             uses a hidden Access function ("#53") - doesn't have the problem
'             where the "Define Custom Color" button is too big
'             Also, allows passing of original colour.
Public Function fChooseColour(Optional lCurrentColor As Long) As Long

  Dim lSaveColor As Long
  lSaveColor = lCurrentColor
  ' Call the dialog
  Call AccChooseColor(Application.hWndAccessApp, lCurrentColor)
  ' Prepare the return value
  If lSaveColor = lCurrentColor Then
    fChooseColour = -1
    fChooseColour = lCurrentColor
  End If
End Function

Thanks a lot guys, especially for the quick replies,
Adam you can also look at this link if you wish web page
Not sure if it is exactly what u want but just throwing info into the mix.
You're welcome Adam, gald we could help.
Nice link Dallr! thumbup.gif
This is a "lo-fi" version of UA. To view the full version with more information, formatting and images, please click here.