Solved

Color of selected push-like check buttons

Posted on 1997-08-13
6
470 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
How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

 
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 Trending Threat Insights Every Day

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

Introduction: Database storage, where is the exe actually on the disc? Playing a game selected randomly (how to generate random numbers).  Error trapping with try..catch to help the code run even if something goes wrong. Continuing from the seve…
Introduction: The undo support, implementing a stack. Continuing from the eigth article about sudoku.   We need a mechanism to keep track of the digits entered so as to implement an undo mechanism.  This should be a ‘Last In First Out’ collec…
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.
This tutorial demonstrates a quick way of adding group price to multiple Magento products.

762 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

Need Help in Real-Time?

Connect with top rated Experts

20 Experts available now in Live!

Get 1:1 Help Now