Quick Search


Tibetan singing bowl music,sound healing, remove negative energy.

528hz solfreggio music -  Attract Wealth and Abundance, Manifest Money and Increase Luck



 
Your forum announcement here!

  Free Advertising Forums | Free Advertising Board | Post Free Ads Forum | Free Advertising Forums Directory | Best Free Advertising Methods | Advertising Forums > Other Methods of FREE Advertising > Guest Books Directory

Guest Books Directory Here is a great way to get some inbound links to your site, and message heard by people who also post and read these books. (Tip: Dont use your real email address on them)

Reply
 
Thread Tools Search this Thread Display Modes
Old 04-11-2011, 11:38 AM   #1
smfuyun172
 
Posts: n/a
Default Windows 7 Ultimate Key Convert hexadecimal color c

Today's guest blogger is Michael Merlin, Lead Software Developer at Electronic Communities. I recently wasted an hour trying to set a field's Back Color property to the hex code generated by the color picker. I figured it out after some searching, but still nobody online had the exact correct answer. I wrote a function that lets you easily use the hex color in code. The secret is to swap the R and the B, and then convert the hex to long. Further explanation follows in the comments of the function. Cheers!
Michael Public Function HexColor(strHex As String) As Long 'converts Hex string to long number,Office Professional 2007, for colors 'the leading # is optional 'example usage 'Me.iSupplier.BackColor = HexColor("FCA951") 'Me.iSupplier.BackColor = HexColor("#FCA951") 'the reason for this function is to programmatically use the 'Hex colors generated by the color picker. 'The trick is,Windows 7 X64, you need to reverse the first and last hex of the 'R G B combination and convert to Long 'so that if the color picker gives you this color #FCA951 'to set this in code, we need to return CLng(&H51A9FC) Dim strColor As String Dim strR As String Dim strG As String Dim strB As String 'strip the leading # if it exists If Left(strHex, 1) = "#" Then strHex = Right(strHex,Microsoft Office Standard 2007, Len(strHex) - 1) End If 'reverse the first two and last two hex numbers of the R G B values strR = Left(strHex, 2) strG = Mid(strHex,Office Pro 2010, 3,Windows 7 Ultimate Key, 2) strB = Right(strHex, 2) strColor = strB & strG & strR HexColor = CLng("&H" & strColor) End Function <div
  Reply With Quote

Sponsored Links
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off


All times are GMT. The time now is 04:34 AM.

 

Powered by vBulletin Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Free Advertising Forums | Free Advertising Message Boards | Post Free Ads Forum