Thread: Checkbox help

  1. #1
    Registered User Welder's Avatar
    Join Date
    Oct 2007
    Location
    Washington
    Posts
    100

    Checkbox help

    I was wondering how to implement Checkboxes in my program using C.

    I have created a checkbox in a dialog box, but don't know how to allow it to be checked. When I click it nothing happens. I also want to know how to get/set it's value.

    Thanks.
    -Nick
    Last edited by Welder; 11-04-2007 at 04:10 PM.

  2. #2
    Registered User
    Join Date
    Mar 2007
    Posts
    416
    This is from one of my projects...

    Code:
    //This is in the dialog resource file
    
        LTEXT           "Known variable",CTEXTONE,405,15,70,13
        AUTOCHECKBOX      "Yes",CHECKONE,405,28,45,10
    
        LTEXT           "Known variable",CTEXTTWO,405,40,70,13
        AUTOCHECKBOX      "Yes",CHECKTWO,405,53,45,10
    
    // AUTOCHECKBOX is different from CHECKBOX
    //This is from the DlgProc(), this gets the check state
    
    CHECKSTATEONE = IsDlgButtonChecked(hwnd,CHECKONE);
    CHECKSTATETWO = IsDlgButtonChecked(hwnd,CHECKTWO);
    To set the check state check here
    Last edited by scwizzo; 11-04-2007 at 04:25 PM.

  3. #3
    Registered User Welder's Avatar
    Join Date
    Oct 2007
    Location
    Washington
    Posts
    100
    Thanks scwizzo.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. resource.rc CheckBox and Editfield
    By Plasm4 in forum Windows Programming
    Replies: 3
    Last Post: 08-09-2008, 08:24 PM
  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. No Checks i CheckBox
    By CodeJerk in forum Windows Programming
    Replies: 1
    Last Post: 06-09-2003, 10:50 AM
  4. displaying a checkbox to the List view control
    By saif in forum Windows Programming
    Replies: 1
    Last Post: 02-07-2003, 12:21 AM
  5. Missing checkbox...
    By jdinger in forum Windows Programming
    Replies: 4
    Last Post: 03-18-2002, 10:47 PM