Prev: Multiple reference locking/unlockng in formulas
Next: How to limit number of Message Boxes on Validation Error?
From: Peter T on 28 Apr 2010 11:12 That's the constant value for vbWindowbackground, ie a system setting, typically white. I don't understand your question, you can apply that constant directly. If you want to return the user's system colour(s) it's easy enough with the GetSystemColor API, but you don't need to, at least to set the colour properties of activeX controls. Curiosity, having informed you how to go about getting a range of colour shades why didn't you follow it up. Regards, Peter T "Paul W Smith" <pws(a)NOSPAM.twelve.me.uk> wrote in message news:eZweyPt5KHA.420(a)TK2MSFTNGP02.phx.gbl... > How does this help me? > > I need something that I can use to color a control background at run time, > so it has to be in the format similar to: > > &H80000005& > > You method below turns a Long number into RGB, but I already have RGB, I > need the...whatveer the definiton is for the thing that has & signs at > each end. > > > > "joel" <joel.4a4py8(a)thecodecage.com> wrote in message > news:joel.4a4py8(a)thecodecage.com... >> >> MyColor = 8210719 >> RedShade = int(MyColor/(256*256)) >> GreenShade = int(MyColor/256) mod 256 >> BlueShade = MyColor Mod 256 >> >> RGB(RedShade,GreenShade,BlueShade) >> >> >> -- >> joel >> ------------------------------------------------------------------------ >> joel's Profile: http://www.thecodecage.com/forumz/member.php?u=229 >> View this thread: >> http://www.thecodecage.com/forumz/showthread.php?t=198482 >> >> http://www.thecodecage.com/forumz >> >> > >
From: Paul W Smith on 28 Apr 2010 12:04 Sorry Peter I have used the method of getting shades by graduating the L value. I was doing this from code so having an RGB value was no issue. This is another issue which is why I tried to start another thread (but failed). What I have is a heading area which is a range of cells colored with one of the theme colour. I have as certained that it is : 8210719, RGB(31,73,125) or #1F49FD I want to place a control on this header range of cells and match the control's background color to the color of the cells. Using the proprties on the control I want to set the background color but I cannot find anything that it will accept. It will not accept #1F49FD so what do I do? I know I could write something into the worksheet.activate event that colors the control because this would be doing it vua code, which I can do because I use the RGB function, but surely ther is a better way i coulod do it at design time? "Peter T" <peter_t(a)discussions> wrote in message news:O9OfkUu5KHA.3652(a)TK2MSFTNGP02.phx.gbl... > That's the constant value for vbWindowbackground, ie a system setting, > typically white. I don't understand your question, you can apply that > constant directly. If you want to return the user's system colour(s) it's > easy enough with the GetSystemColor API, but you don't need to, at least > to set the colour properties of activeX controls. > > Curiosity, having informed you how to go about getting a range of colour > shades why didn't you follow it up. > > Regards, > Peter T > > > "Paul W Smith" <pws(a)NOSPAM.twelve.me.uk> wrote in message > news:eZweyPt5KHA.420(a)TK2MSFTNGP02.phx.gbl... >> How does this help me? >> >> I need something that I can use to color a control background at run >> time, so it has to be in the format similar to: >> >> &H80000005& >> >> You method below turns a Long number into RGB, but I already have RGB, I >> need the...whatveer the definiton is for the thing that has & signs at >> each end. >> >> >> >> "joel" <joel.4a4py8(a)thecodecage.com> wrote in message >> news:joel.4a4py8(a)thecodecage.com... >>> >>> MyColor = 8210719 >>> RedShade = int(MyColor/(256*256)) >>> GreenShade = int(MyColor/256) mod 256 >>> BlueShade = MyColor Mod 256 >>> >>> RGB(RedShade,GreenShade,BlueShade) >>> >>> >>> -- >>> joel >>> ------------------------------------------------------------------------ >>> joel's Profile: http://www.thecodecage.com/forumz/member.php?u=229 >>> View this thread: >>> http://www.thecodecage.com/forumz/showthread.php?t=198482 >>> >>> http://www.thecodecage.com/forumz >>> >>> >> >> > > >
From: joel on 28 Apr 2010 12:28 the number &H80000005& is a hexidecimal number. The 8 indicates the sign bit is set so you really have in bits FFFFFFFB (2's compliment). This isn't a color!!! -- joel ------------------------------------------------------------------------ joel's Profile: http://www.thecodecage.com/forumz/member.php?u=229 View this thread: http://www.thecodecage.com/forumz/showthread.php?t=198482 http://www.thecodecage.com/forumz
From: Peter T on 28 Apr 2010 12:45 I'm getting even more confused! It looks like you have moved on now from values like &H80000005& and system colours to standard RGB values > 8210719, RGB(31,73,125) or #1F49FD Where did you get #1F49FD from, it doesn't relate to the RGB or long colour value in any way I can tell. The hex value is &H7D491F, and can be applied just like that, but the equivalent for what is sometimes known as WebHex is #1F497D (notice individual 3 hex values are reversed). FWIW webHex #1F49FD is RGB(31,73,253) All colour properties of controls accept RGB longs, so if you want to apply that (incorrect) # value you'll need to parse it with the mid function, then add "&H" coerce it to a long value. ActiveX controls can also accept the window system colour constants, like your &H80000005&. > I have used the method of getting shades by graduating the L value. > I was doing this from code so having an RGB value was no issue. I don't understand what you've been doing there at all but not to worry. Regards, Peter T "Paul W Smith" <pws(a)NOSPAM.twelve.me.uk> wrote in message news:OFUOHyu5KHA.3184(a)TK2MSFTNGP05.phx.gbl... > Sorry Peter I have used the method of getting shades by graduating the L > value. I was doing this from code so having an RGB value was no issue. > > This is another issue which is why I tried to start another thread (but > failed). > > What I have is a heading area which is a range of cells colored with one > of the theme colour. I have as certained that it is : > > 8210719, RGB(31,73,125) or #1F49FD > > I want to place a control on this header range of cells and match the > control's background color to the color of the cells. Using the proprties > on the control I want to set the background color but I cannot find > anything that it will accept. It will not accept #1F49FD so what do I do? > > I know I could write something into the worksheet.activate event that > colors the control because this would be doing it vua code, which I can do > because I use the RGB function, but surely ther is a better way i coulod > do it at design time? > > > > > > "Peter T" <peter_t(a)discussions> wrote in message > news:O9OfkUu5KHA.3652(a)TK2MSFTNGP02.phx.gbl... >> That's the constant value for vbWindowbackground, ie a system setting, >> typically white. I don't understand your question, you can apply that >> constant directly. If you want to return the user's system colour(s) it's >> easy enough with the GetSystemColor API, but you don't need to, at least >> to set the colour properties of activeX controls. >> >> Curiosity, having informed you how to go about getting a range of colour >> shades why didn't you follow it up. >> >> Regards, >> Peter T >> >> >> "Paul W Smith" <pws(a)NOSPAM.twelve.me.uk> wrote in message >> news:eZweyPt5KHA.420(a)TK2MSFTNGP02.phx.gbl... >>> How does this help me? >>> >>> I need something that I can use to color a control background at run >>> time, so it has to be in the format similar to: >>> >>> &H80000005& >>> >>> You method below turns a Long number into RGB, but I already have RGB, I >>> need the...whatveer the definiton is for the thing that has & signs at >>> each end. >>> >>> >>> >>> "joel" <joel.4a4py8(a)thecodecage.com> wrote in message >>> news:joel.4a4py8(a)thecodecage.com... >>>> >>>> MyColor = 8210719 >>>> RedShade = int(MyColor/(256*256)) >>>> GreenShade = int(MyColor/256) mod 256 >>>> BlueShade = MyColor Mod 256 >>>> >>>> RGB(RedShade,GreenShade,BlueShade) >>>> >>>> >>>> -- >>>> joel >>>> ------------------------------------------------------------------------ >>>> joel's Profile: http://www.thecodecage.com/forumz/member.php?u=229 >>>> View this thread: >>>> http://www.thecodecage.com/forumz/showthread.php?t=198482 >>>> >>>> http://www.thecodecage.com/forumz >>>> >>>> >>> >>> >> >> >> > >
From: Peter T on 28 Apr 2010 12:48 As I have already tried to explain, its a constant. Namely vbWindowBackground, used to return a system colour. Regards, Peter T "joel" <joel.4a5074(a)thecodecage.com> wrote in message news:joel.4a5074(a)thecodecage.com... > > the number &H80000005& is a hexidecimal number. The 8 indicates the > sign bit is set so you really have in bits > > FFFFFFFB (2's compliment). This isn't a color!!! > > > -- > joel > ------------------------------------------------------------------------ > joel's Profile: http://www.thecodecage.com/forumz/member.php?u=229 > View this thread: > http://www.thecodecage.com/forumz/showthread.php?t=198482 > > http://www.thecodecage.com/forumz >
First
|
Prev
|
Next
|
Last
Pages: 1 2 3 4 Prev: Multiple reference locking/unlockng in formulas Next: How to limit number of Message Boxes on Validation Error? |