Results 1 to 9 of 9
  1. #1
    Lounger
    Join Date
    Mar 2002
    Location
    Cincinnati
    Posts
    36
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Matching Control Colors (Excel2kWin2k)

    I would like to build sheets where the controls I add have no border with colors on the sheet. However, as I add controls, I see that the colors I can choose from relate to MS' color styles and don't conform to the 56 color choices I have. I've changed one of those 56 color choices and gotten very close. If I could tell the RGB of the ButtonFace color I could get an exact match. How does one find out the RGB of, say, the backcolor of an object in the (x,x,x) format so it can be used to set the standard 56 color palette? Or, am I missing some easy way to make the interior of a cell the same color as the backcolor of a control (not fair to just set the one to the other in VBA: I don't want to have to write a program to do it each time!)?

  2. #2
    Bronze Lounger
    Join Date
    Jun 2001
    Location
    New York, New York, Lebanon
    Posts
    1,449
    Thanks
    1
    Thanked 1 Time in 1 Post

    Re: Matching Control Colors (Excel2kWin2k)

    <img src=/S/hello.gif border=0 alt=hello width=25 height=29> WDI

    OK so you are placing these controls on a worksheet. And you want to color them, or have them all the same color?

    There is an RGB property that might help you, and it is in the OLH. Here is the example used in the OLH:

    Worksheets(1).Range("A1:A10").Interior.Color = Charts(1).ChartArea.Fill.ForeColor.RGB

    I suppose you could replace the Range with the name of the control and you should be set. If you can't well at least you can color the range under and around the control.

    HTH

    Wassim <img src=/S/compute.gif border=0 alt=compute width=40 height=20>
    <img src=/S/compute.gif border=0 alt=compute width=40 height=20> in the <img src=/S/bagged.gif border=0 alt=bagged width=22 height=22>

  3. #3
    Lounger
    Join Date
    Mar 2002
    Location
    Cincinnati
    Posts
    36
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Matching Control Colors (Excel2kWin2k)

    I can set one object's color to another using the .RGB property, but only with a program. What I want to do is have a color in the normal pull down box that is set to the standard control gray. The properties box for a control gives the colors, but in the form of some long alphanumeric code: how translate that into the RGB numbers? If I had the exact RBG numbers I could modify the pull down color palette to include a gray like that on a control.

  4. #4
    Lounger
    Join Date
    Mar 2002
    Location
    Cincinnati
    Posts
    36
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Matching Control Colors (Excel2kWin2k)

    I downloaded a copy of Korax ColorDrop that will give me the RGB of any color on the screen. But I also learned that the Excel Controls are bound to colors which change with the windows palette setting (e.g., "Buttonface"). So I have a new question: if I want to send a spreadsheet to someone who may have their palette set differently than mine, how do I manage to set the colors of the sheet so that a control disappears into the background (e.g., an option button appears just as a dot, not as an ugly rectangle that includes a dot)? Is there a way for me to set an excel interior color to one of those named colors, like "Buttonface" and have it change dynamically if the user changes their palette setting?

  5. #5
    Platinum Lounger
    Join Date
    Nov 2001
    Location
    Vienna, Wien, Austria
    Posts
    5,009
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Matching Control Colors (Excel2kWin2k)

    The last 6 characters (before the final &) are standard hexadecimal codes. What you probably need is a standard RGB to hexadecimal converter. These have been readily available as freeware on the Web - mostly in connection with HTML accessories. If you can get hold of a graphics program such as Paint Shop Pro (or possibly an HTML editor), that will also enable you to identify the hexadecimal codes for your 56 colours. (Unfortunately neither PhotoDraw not FrontPage 2000 offer these capabilties.) While the controls do not take all hexadecimal combinations, some testing seems to show that they may well take your 56. HTH
    Gre

  6. #6
    Lounger
    Join Date
    Mar 2002
    Location
    Cincinnati
    Posts
    36
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Matching Control Colors (Excel2kWin2k)

    OK, I think I have this problem solved, but would appreciate it if anyone would clarify any mistakes in the following:
    The problem is that Excel assigns "named" system colors to controls if you use the system palette when choosing colors for controls. On the other hand, if you choose the second option, the "Palette" when selecting colors for controls, these are set to the current setting of that palette, which may not agree with the original developer's palette. But there is a third option, and that is to create a new custom color on this palette, because custom colors get assigned to a component only when a user is picking a color for the component (that is, Excel assigns the hard value of the color, not the name of the color). So if the user changes the palette long after the program was developed, this does not change all the things that had been set to the previous value by the original developer. So to guarantee that your component colors match your sheet colors, all you need do is make sure there is a custom color in the component palette that matches the color in the normal sheet 56 color pull down, and then religiously assign that color when adding components to a workbook. Then no matter how the user changes their system settings, your work will still be consistent.

    Have I missed something simple that would eliminate this concern?

  7. #7
    Lounger
    Join Date
    Mar 2002
    Location
    Cincinnati
    Posts
    36
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Matching Control Colors (Excel2kWin2k)

    Thanks, unkamunka, for your suggestions. The Korax tool does compute in Hex. I have been able to determine the RGB value of the "Button Face" color, and then create custom colors on my 56 color pull down and also on the palette for controls that create this color. Everything matches up just as I hoped. The only confusion now is that the value I see in the Korax hex calculator does not agree with the value shown in the properties box for the control. I assume I just drop the leading "&H00" and the trailing "&" and then compare, right? The properties box shows: &H00CED3D6& while the Korax tool shows a hex value of D6D3CE when I pick the color off the screen. I get the same HEX value from Korax for both the control and for the new area on the sheet that colored with the 56 color drop down selection I created. In both cases I used an RGB of 214,211,206 to create the new colors, and that is the RGB that Korax says is there when I pick up the color from the screen. Why don't the Hex values agree?

  8. #8
    Platinum Lounger
    Join Date
    Nov 2001
    Location
    Vienna, Wien, Austria
    Posts
    5,009
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Matching Control Colors (Excel2kWin2k)

    Not too sure. I know when I tested in PSP it seemed an extremely close match to me. You have noticed, I hope, that it seems as if the order of the colours has been reversed. (The ranges principally operate in pairs.) In true terms, however, CED3D6 is a "true" pale grey; whereas D6D3CE is a slate blue grey.

    If you want to double check, you could always use your browser and some simple html. Make a new file in Notepad and enter:

    <html><body bgcolor="#D6D3CE"></body></html>

    saving the file with an .htm (or .html) extension. You should see the technical difference between the two colours. If the codes in both pieces of software are working correctly, I can only suggest that there may be something in your graphics card settings. That, however, seems a bit strange to me and is a hardware area about which I lknow very little. HTH
    Gre

  9. #9
    Super Moderator WebGenii's Avatar
    Join Date
    Jan 2001
    Location
    Redcliff, Alberta, Canada
    Posts
    4,066
    Thanks
    2
    Thanked 5 Times in 5 Posts

    Re: Matching Control Colors (Excel2kWin2k)

    Just on a philosophical note, as I follow this discussion. I know that designers often go to great lengths to make dialog boxes "new" and "fresh" and worst of all, "different".
    My most disastrous encounter with this, was the project where the designer felt that option buttons were more aesthetically pleasing than checkboxes and substituted them accorrdingly! I had the dubious pleasure of teaching this application and I felt for the confused audience.
    An excellent site which discusses design is http://useit.com. Though he is discussing web design, much of what Jakob Nielsen recommends can be applied to application design as well.

    Just my <img src=/S/2cents.gif border=0 alt=2cents width=15 height=15>!

    Cheers
    [b]Catharine Richardson (WebGenii)
    WebGenii Home Page
    Moderator: Spreadsheets, Other MS Apps, Presentation Apps, Visual Basic for Apps, Windows Mobile

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •