[2 days left] What’s wrong with your cloud strategy? Learn why multicloud solutions matter with Nimble Storage.Register Now

x
?
Solved

Owner Draw radio button

Posted on 1997-09-11
1
Medium Priority
?
978 Views
Last Modified: 2013-11-20
I want (need) to be able to create radio buttons that are owner-drawn (like a CBitmapButton) but still act like radio buttons.

I tried setting BS_OWNERDRAW in my .RC file and writing a class similar to CBitmapButton but with a DrawItem that tests GetCheck() value and draws the appropriate bitmap (down for checked, up for unchecked, etc.)

But this did not work - BS_OWNERDRAW is 0x0b and BS_AUTORADIOBUTTON is 0x09 (1011 and 1001). If you OR them, you get 0x0b - BS_OWNERDRAW. Consequently, the button acts as if it were a normal CBitmapButton and the GetCheck() member always returns 0, even if I do a SetCheck(1) immediately before.

So, is there any reasonable way to do this?
0
Comment
Question by:chrisdl
[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
1 Comment
 
LVL 15

Accepted Solution

by:
Tommy Hui earned 200 total points
ID: 1306150
Instead of supplying the BS_OWNERDRAW flag, another possibility would be to subclass the window and handle all of the painting yourself by catching WM_PAINT. Since you're going to be doing all tthe drawing anyway, this would be the better way to go. Your code would have to handle various states: focus and selected. Otherwise, it is pretty straight forward.
0

Featured Post

Survive A High-Traffic Event with Percona

Your application or website rely on your database to deliver information about products and services to your customers. You can’t afford to have your database lose performance, lose availability or become unresponsive – even for just a few minutes.

Question has a verified solution.

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

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…
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.
In a question here at Experts Exchange (https://www.experts-exchange.com/questions/29062564/Adobe-acrobat-reader-DC.html), a member asked how to create a signature in Adobe Acrobat Reader DC (the free Reader product, not the paid, full Acrobat produ…

649 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