Solved

Color of selected push-like check buttons

Posted on 1997-08-13
6
506 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
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

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
matchUp  challenge 6 76
Line meaning 9 89
Thin secure Windows 10 5 107
How do I get Window Title of all opened process? 4 32
In this article, I'll describe -- and show pictures of -- some of the significant additions that have been made available to programmers in the MFC Feature Pack for Visual C++ 2008.  These same feature are in the MFC libraries that come with Visual …
In this post we will learn different types of Android Layout and some basics of an Android App.
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.
Nobody understands Phishing better than an anti-spam company. That’s why we are providing Phishing Awareness Training to our customers. According to a report by Verizon, only 3% of targeted users report malicious emails to management. With compan…

735 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