Solved

Color of selected push-like check buttons

Posted on 1997-08-13
6
509 Views
Last Modified: 2013-11-19
I would like to retrieve the color used for filling
a selected push-like check button.

1) Is it a solid color, or some sort of stippling?
2) If color, is there a way to get it with GetSysColor
   (none of the macros correspond).
3) Is it possible to calculate it, given the BTNFACE color?

Any answer which will explain how Windows draws the push
style check button, will be welcome.
0
Comment
Question by:mco
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
6 Comments
 
LVL 3

Expert Comment

by:byang
ID: 1303721
What's a "push style check button" ? Do you mean:
1. regular checkbox (square box at the left), or
2. radio checkbox (circle at the left), or
3. regular button with a checkmark on it

0
 
LVL 7

Expert Comment

by:galkin
ID: 1303722
Id this button is standard you can get button face color by calling GetSysColor(COLOR_BTNFACE), light color by calling GetSysColor(COLOR_3DLIGHT),and shadow color by calling GetSysColor(COLOR_3DSHADOW).
0
 
LVL 1

Author Comment

by:mco
ID: 1303723
No, this does not work. I looked at the value of
COLOR_3DLIGHT for many color schemes and it is equal to
the value of COLOR_BTNFACE. Visually, these are two different
colors where the selected check button color is lighter
but similar. It is darker, though, than COLOR_3DHILIGHT used for the light shadow edge.
COLOR_3DSHADOW is the dark shadow edge that is even darker than
COLOR_BTNFACE.


To answer byang's question:
I do not mean any of the 3 you stated.
I mean a button with the style BS_AUTOCHECKBOX | BS_PUSHLIKE .
This is what you get when in Visual C++ resource editor
you create a check box and select the "push-like" attribute.
On the button you have the button's text.


0
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 10

Expert Comment

by:RONSLOW
ID: 1303724
Have a look at DrawFrameControl which draws all sorts of buttons in various states.  Also look at DrawState.


0
 
LVL 1

Author Comment

by:mco
ID: 1303725
RONSLOW, playing around with DrawState brought me
to see that the selected check buttons are drawn
with the same color but DITHERED. Actually that can be done more easily using GetHalftoneBrush(), since I am using one color.

Since the purpose of my question was to understand how
Windows chooses the color, I have the complete answer.

You wrote it as a comment. If you write it (or something)
again as an ANSWER, I will award you all the possible points.


0
 
LVL 10

Accepted Solution

by:
RONSLOW earned 120 total points
ID: 1303726
Here you go - thanks for the points :-)

Have a look at DrawFrameControl which draws all sorts of buttons in various states. Also look at DrawState.
0

Featured Post

On Demand Webinar - Networking for the Cloud Era

This webinar discusses:
-Common barriers companies experience when moving to the cloud
-How SD-WAN changes the way we look at networks
-Best practices customers should employ moving forward with cloud migration
-What happens behind the scenes of SteelConnect’s one-click button

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
while loop over for loop 7 119
Use of condition with 'serial' in ansible 2 102
changeXy challenge 13 98
Problem to event 3 123
Introduction: Load and Save to file, Document-View interaction inside the SDI. Continuing from the second article about sudoku.   Open the project in visual studio. From the class view select CSudokuDoc and double click to open the header …
Introduction: Ownerdraw of the grid button.  A singleton class implentation and usage. Continuing from the fifth article about sudoku.   Open the project in visual studio. Go to the class view – CGridButton should be visible as a class.  R…
This video will show you how to get GIT to work in Eclipse.   It will walk you through how to install the EGit plugin in eclipse and how to checkout an existing repository.
In a recent question (https://www.experts-exchange.com/questions/29004105/Run-AutoHotkey-script-directly-from-Notepad.html) here at Experts Exchange, a member asked how to run an AutoHotkey script (.AHK) directly from Notepad++ (aka NPP). This video…

738 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question