News:

Masm32 SDK description, downloads and other helpful links
Message to All Guests

Main Menu

Setting the value of a radiobutton in a dialog box

Started by gelatine1, January 16, 2016, 08:17:57 AM

Previous topic - Next topic

gelatine1

Hi, I have the following rc file (snippet) describing a dialog box with 2 radio buttons.


MyDialog DIALOG 10, 10, 150, 70
CAPTION "Change start and end"
BEGIN
    DEFPUSHBUTTON   "Confirm", IDC_CONFIRM,    91,10,52,13
    PUSHBUTTON      "Cancel", IDC_EXIT,  91,26,52,13
    AUTORADIOBUTTON "Random", IDC_RADIO_LINEAR , 12,45,40,13, 131072 // 131072 = WS_GROUP
    AUTORADIOBUTTON "Linear", IDC_RADIO_RANDOM , 62,45,30,13
END


When I initialise the dialog box both the radiobuttons appear not selected. How would I select one of the radiobuttons from within my code (after WM_INITDIALOG) ?

Thanks in advance

ragdog

Hello

invoke CheckDlgButton,hWnd,1002,BST_CHECKED

Regards,

dedndave

actually, radio buttons have their own function, used to select which button of a group is checked

CheckRadioButton

https://msdn.microsoft.com/en-us/library/windows/desktop/bb761877%28v=vs.85%29.aspx

gelatine1

Okay thanks! clearly I was looking in the wrong place..