Thread: Default checking of radio button in a group box

  1. #1
    Registered User
    Join Date
    Oct 2001
    Posts
    17

    Default checking of radio button in a group box

    Sir,


    On a window I have a group box which contains two radio buttons.

    what I require is that when my window opens one of the radio button in that group box should be in the checked state. ( The window contains various other controls also like edit boxes and combo boxes )

    How can I do so.

  2. #2
    Registered User
    Join Date
    Sep 2001
    Posts
    164
    Just send a message to the checkbox. I think it's like ??_SETCHECK.
    // Gliptic

  3. #3
    It's full of stars adrianxw's Avatar
    Join Date
    Aug 2001
    Posts
    4,829
    Yes. To set a radio button send a BM_SETCHECK message to the control with wParam set to BST_CHECKED, to clear it set wParam to BST_UNCHECKED.
    Wave upon wave of demented avengers march cheerfully out of obscurity unto the dream.

  4. #4
    train spotter
    Join Date
    Aug 2001
    Location
    near a computer
    Posts
    3,868
    And do this under the WM_INIT or WM_CREATE msg.

    PS (As far as I know none of these people are deserving of YOU calling them SIR. If you want to call ME sir, go right ahead.)
    "Man alone suffers so excruciatingly in the world that he was compelled to invent laughter."
    Friedrich Nietzsche

    "I spent a lot of my money on booze, birds and fast cars......the rest I squandered."
    George Best

    "If you are going through hell....keep going."
    Winston Churchill

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Tab Controls - API
    By -KEN- in forum Windows Programming
    Replies: 7
    Last Post: 06-02-2002, 09:44 AM
  2. moving a dialog box and making a button a bitmap
    By Unregistered in forum Windows Programming
    Replies: 5
    Last Post: 05-22-2002, 04:38 AM
  3. Dialog Boxes - Radio Button mischief
    By MrWizard in forum Windows Programming
    Replies: 2
    Last Post: 05-15-2002, 08:06 PM
  4. Radio button linked to text box
    By J_Bravo in forum Windows Programming
    Replies: 9
    Last Post: 05-07-2002, 10:15 PM
  5. Default checking of radio button in a group box
    By juhigarg in forum C++ Programming
    Replies: 2
    Last Post: 11-07-2001, 01:31 AM