hi Kevin,
no need to write a color scheme database, it has already been done. I wrote a color picker years ago, and then AD Tejpal added on. I thought it was posted somewhere on the site, but I couldn't find it, so I uploaded it to:
https://groups.yahoo.com/neo/groups/MS_Access_Professionals/files/Crystal/
ColorPicker_by_Crystal_AD_MD_130430.ziphave an awesome day,
crystal
free code you can use in your projects
https://msaccessgurus.com/code.htm
On 3/8/2019 3:00 AM, Kevin [MS_Access_Professionals] wrote:
Dear Crystal,
Thanks a lot. I am trying to build a color scheme database myself.
Best Regards,
Kevin
On 08-Mar-2019 4:41 PM, crystal [MS_Access_Professionals] wrote:
hi Kevin,
BackColor will never be Null. BackStyle might be Transparent (0) -- Normal is 1.
You can also set Color using RGB (Red, Green, Blue) like this:
..BackColor = RGB( 255, 255, 255) 'white
To answer your question though, you can preface with &H and use CLng to convert to Long.
psHex is a string with a Hex code:
'~~~~~~~~~~~~~~~~~
Function GetDecFromHex(psHex As String) As Long
's4p
If InStr(psHex, "&H") = 0 Then
GetDecFromHex = CLng("&H" & psHex)
Else
GetDecFromHex = CLng(psHex)
End If
End Function
'~~~~~~~~~~~~~~~~~
have an awesome day,
crystal
On 3/8/2019 1:50 AM, Kevin [MS_Access_Professionals]
wrote:
> Dear All,
>
> Is it possible to convert color string into hex? So that I can apply it
> in code to customize the color of forms? Thanks in advance.
>
> I expect to get this result:
>
> Me.Color.BackColor=IIf(IsNull(Me.ColorCode),Color_Hex_To_Long("#FFFFFF"),Color_Hex_To_Long(Me.ColorCode))
>
>
> Best Regards,
>
> Kevin
>
>
>
> ------------------------------------
> Posted by: Kevin <qingqinga@yahoo.com>
> ------------------------------------
>
>
> ------------------------------------
>
> Yahoo Groups Links
>
>
>
Posted by: qingqinga <qingqinga@yahoo.com>
Reply via web post | • | Reply to sender | • | Reply to group | • | Start a New Topic | • | Messages in this topic (7) |
Tidak ada komentar:
Posting Komentar