Jumat, 08 Maret 2019

Re: [MS_AccessPros] Converting String to Hex

 

Dear Crystal,
I just saw your reply this morning because of the time difference. Thanks a lot.
Best Regards,
Kevin

发自 WPS邮箱客戶端
在 "crystal 8 strive4peace2008@yahoo.com [MS_Access_Professionals]" <MS_Access_Professionals@yahoogroups.com>,2019年3月9日 05:32写道:

 

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.zip

have 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)

Have you tried the highest rated email app?
With 4.5 stars in iTunes, the Yahoo Mail app is the highest rated email app on the market. What are you waiting for? Now you can access all your inboxes (Gmail, Outlook, AOL and more) in one place. Never delete an email again with 1000GB of free cloud storage.


SPONSORED LINKS
.

__,_._,___

Tidak ada komentar:

Posting Komentar