how do i set the .Color property of the common dialog? sounds simple but i dont know what format it uses..
cheers
Printable View
how do i set the .Color property of the common dialog? sounds simple but i dont know what format it uses..
cheers
VB Code:
CD.color = RGB(r, g, b) CD.color = vbGreen
There are many ways.
cheers :) but i got 1 more problem :P is this the only way to retrieve the colours from the dialog:
VB Code:
Red = cdlColour.Color And &HFF Green = (cdlColour.Color \ &H100) And &HFF Blue = cdlColour.Color \ &H10000
No. This is a much more convenient way:VB Code:
Private Type mLong L As Long End Type Private Type mRGB R As Byte G As Byte B As Byte RESERVED As Byte End Type Private Function GetRGB(Co As Long) As mRGB Dim Q As mLong Q.L = Co LSet GetRGB = Q End Function '// USAGE: Dim Q As mRGB Q = GetRGB(cdlColour.Color) Msgbox Q.R Msgbox Q.G Msgbox Q.B
thats a bit complex and i havent got a clue what it does :P aint there any other more simple ways of gettin it done?
cheers
No, this is pretty complicated. It has to be. Sure, if you were in C/C++, you could just shift bits to get the answer. But we can't. If you stick in mine, all you need is two lines of code to get it the RGB value. And it's fast ;)