Thread: Checkbox as Groupbox Title

  1. #1
    Registered User
    Join Date
    Aug 2004
    Posts
    193

    Checkbox as Groupbox Title

    I was wondering how to set the title of a groupbox to be a checkbox. I was able to create a groupbox and checkbox and place the checkbox over the groupbox where a title would appear, but the color of the text of the checkbox isnt the same color as the color of the text of a normal groupbox title. I know I could change the color of the text and all, but I was wondering if there was a more proper way to do this.

    Thanks in advance for any help!!!

  2. #2
    Reverse Engineer maxorator's Avatar
    Join Date
    Aug 2005
    Location
    Estonia
    Posts
    2,318
    I have never seen a groupbox with a checkbox title, but I have seen checkboxes, that hide groupboxes if they're not selected (or disables).
    "The Internet treats censorship as damage and routes around it." - John Gilmore

  3. #3
    Registered User
    Join Date
    Aug 2004
    Posts
    193
    Here is a screenshot of what it looks like from codeproject.com:

    http://www.codeproject.com/buttonctr...GroupCheck.gif

    I tried following their tutorial type thing, but I couldnt figure it out.

  4. #4
    Reverse Engineer maxorator's Avatar
    Join Date
    Aug 2005
    Location
    Estonia
    Posts
    2,318
    Well, I can't even test it because I can't compile MFC.

    There are other MFC groupbox checkbox tutorials:
    http://www.codeguru.com/cpp/cpp/cpp_...cle.php/c4149/
    "The Internet treats censorship as damage and routes around it." - John Gilmore

  5. #5
    Registered User
    Join Date
    Aug 2004
    Posts
    193
    I decided to just have a checkbox on top of the groupbox. The checkbox has no text, and the groupbox has the text with like 5 spaces in front of it to accomodate for the checkbox. I then added WM_LBUTTONDOWN and WM_MOUSEMOVE messages so if the user rolls their mouse over any part of the groupbox, then the checkbox will be highlighted or if the user clicks anywhere in the groupbox, then the checkbox is checked. I think what I have right now is the best I'll get it so the this thread is solved.

    Thanks for your help.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Extract Title from plain text file
    By Todd88 in forum C++ Programming
    Replies: 10
    Last Post: 11-21-2008, 09:47 AM
  2. setting checks on checkbox , setcheck not working
    By hanhao in forum Windows Programming
    Replies: 2
    Last Post: 06-30-2007, 09:38 PM
  3. Program Crashing
    By Pressure in forum C Programming
    Replies: 3
    Last Post: 04-18-2005, 10:28 PM
  4. Child window with active (highlighted) title bar: Possible?
    By JasonD in forum Windows Programming
    Replies: 7
    Last Post: 10-16-2003, 06:43 AM
  5. How can we really group the controls in groupbox
    By Unregistered in forum Windows Programming
    Replies: 3
    Last Post: 05-29-2002, 01:08 PM