Thread: Dialog Boxes - Radio Button mischief

  1. #1
    Registered User
    Join Date
    Apr 2002
    Posts
    1,571

    Dialog Boxes - Radio Button mischief

    I have a display setup dialog box with 3 different groups of radio buttons. One for full / Windowed mode select, one for bits per pixel select, and one for resolution select.
    Now they are each in their respective static boxes. How do I make it where when I select my bpp one and then click resolution the black dot does not jump groups. I see the group tag in the resource editor but that kept messing up. Also, how do I initially set one of the radio buttons to marked in the WM_INITDIALOG message? Thanks for your time. If you don't read my sig I'm using VC++ 6.0 PRO

    -MrWizard

  2. #2
    Registered User sean345's Avatar
    Join Date
    Mar 2002
    Posts
    346
    You should use group boxes to group the radio buttons, that should stop the black dot from jumping between groups. To set the radio button to checked you can use:
    Code:
    SendMessage(hWnd, BM_SETCHECK, BST_CHECKED, 0);
    Here is some info on BM_SETCHECK
    An application sends a BM_SETCHECK message to set the check state of a radio button or check box.

    BM_SETCHECK
    wParam = (WPARAM) fCheck; // check state
    lParam = 0; // not used; must be zero


    Parameters

    fCheck

    Value of wParam. Specifies the check state. This parameter can be one of the following values:

    Value Meaning
    BST_CHECKED Sets the button state to checked.
    BST_INDETERMINATE Sets the button state to grayed, indicating an indeterminate state. Use this value only if the button has the BS_3STATE or BS_AUTO3STATE style.
    BST_UNCHECKED Sets the button state to unchecked
    Return Values

    This message always returns zero.

    Remarks

    The BM_SETCHECK message has no effect on push buttons.
    - Sean
    If cities were built like software is built, the first woodpecker to come along would level civilization.
    Black Frog Studios

  3. #3
    Registered User
    Join Date
    Apr 2002
    Posts
    1,571
    Thanks for the reply, will try that now.

    -MrWizard

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. BN_CLICKED, change button style
    By bennyandthejets in forum Windows Programming
    Replies: 13
    Last Post: 07-05-2010, 11:42 PM
  2. Replies: 9
    Last Post: 02-13-2008, 02:59 PM
  3. Click button on dialog box to open window.
    By ooosawaddee3 in forum Windows Programming
    Replies: 1
    Last Post: 11-29-2002, 08:53 AM
  4. Radio button is it checked?
    By Bajanine in forum Windows Programming
    Replies: 2
    Last Post: 11-21-2002, 07:08 PM
  5. Tab Controls - API
    By -KEN- in forum Windows Programming
    Replies: 7
    Last Post: 06-02-2002, 09:44 AM