Jumat, 08 Maret 2019

Re: [MS_AccessPros] Converting String to Hex

 

Kevin,
Be aware that if you select a colored item, all colors appear reversed.
Dave W

On 08/03/2019 10:24, Kevin qingqinga@yahoo.com [MS_Access_Professionals]
wrote:
>
> Dear Crystal,
>
> After running the code. I put "FFF200",  It is supposed to be yellow,
> but it appears blue... The color is different from the one in the form
> property. Is there anything wrong?
>
> Best Regards,
>
> Kevin
>
> On 08-Mar-2019 4:41 PM, crystal 8 strive4peace2008@yahoo.com
> [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 qingqinga@yahoo.com [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: Dave Williams <davewillgmale@gmail.com>
Reply via web post Reply to sender Reply to group Start a New Topic Messages in this topic (5)

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