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
Solved

Color of selected push-like check buttons

Posted on 1997-08-13
6
499 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
Free Tool: Postgres Monitoring System

A PHP and Perl based system to collect and display usage statistics from PostgreSQL databases.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

 
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: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone 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
function returning CString in a regular win32 DLL 8 188
repeateFront java challenge 31 94
Excel Use VBA to get user's Mac Address for their computer 5 240
Detect CR LF to each line 12 169
Here is how to use MFC's automatic Radio Button handling in your dialog boxes and forms.  Beginner programmers usually start with a OnClick handler for each radio button and that's just not the right way to go.  MFC has a very cool system for handli…
Introduction: Dialogs (2) modeless dialog and a worker thread.  Handling data shared between threads.  Recursive functions. Continuing from the tenth article about sudoku.   Last article we worked with a modal dialog to help maintain informat…
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.
Although Jacob Bernoulli (1654-1705) has been credited as the creator of "Binomial Distribution Table", Gottfried Leibniz (1646-1716) did his dissertation on the subject in 1666; Leibniz you may recall is the co-inventor of "Calculus" and beat Isaac…

789 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