Retro video games delivered to your door every month!
Click above to get retro games delivered to your door ever month!
X-Hacker.org- The Guide to Clip-4-Win version 3.0 - <b>checkradiobutton()</b> http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
CheckRadioButton()
Add a check mark to a radio button in a group and clear the others
------------------------------------------------------------------------------

Syntax
CheckRadioButton( <aDlg>, <cStartId>, <cEndId>, <cId> )   -->  nil

OR:

CheckRadioButton( <hWndDlg>, <nStartId>, <nEndId>, <nId> )   -->   nil

Arguments

EITHER:

<aDlg> is an array used to describe the dialog, obtained from
CreateDialog().

<cStartId> is a character string identifying the first radio
button in the group.

<cEndId> is a character string identifying the last radio
button in the group.

<cId> is a character string identifying the radio button that
is to be marked on.

OR:

<hWndDlg> is the handle of the dialog window.

<nStartId> is the numeric id of the first radio button in the
group.

<nEndId> is the numeric id of the last radio button in the
group.

<nId> is the numeric id of the radio button that is to be
marked on.

Returns
NIL.

Description

EITHER:
Once a dialog has been set up using CreateDialog() and
AppendDialog(), this function can be used to set the initial
state of radio buttons.

OR:
For a dialog created from a dialog resource by DialogBox() or
the second form of CreateDialog(), this function can be used
to set the current state of a group of radio buttons (one on,
the rest off).

Example
aDlg = CreateDialog("Sample Dialog",                        ;
              WS_CAPTION + WS_VSCROLL + WS_HSCROLL          ;
              + WS_SYSMENU + WS_GROUP + WS_TABSTOP          ;
              + WS_THICKFRAME + WS_VISIBLE + WS_POPUP,      ;
              24, 12, 180, 160)

aDlg = AppendDialog(aDlg, "ok", DLG_BUTTON,                 ;
              BS_DEFPUSHBUTTON + WS_TABSTOP                 ;
              + WS_CHILD + WS_VISIBLE,                      ;
              136, 112, 24, 14,  "&Ok")

aDlg = AppendDialog(aDlg, "radio", DLG_BUTTON,              ;
              BS_AUTORADIOBUTTON + WS_TABSTOP               ;
              + WS_GROUP + WS_CHILD + WS_VISIBLE,           ;
              10, 15, 40, 20,                               ;
              "Radio &A")

aDlg = AppendDialog(aDlg, "radio2", DLG_BUTTON,             ;
              BS_AUTORADIOBUTTON + WS_CHILD                 ;
              + WS_VISIBLE,                                 ;
              10, 40, 40, 20,                               ;
              "Radio &B")

CheckRadioButton(aDlg, "radio", "radio2", "radio")

// Hitting ESCAPE returns 0, in case you want to try it...
i = ModalDialog(aDlg, hInst, hWnd)
s = GetDialogResult(aDlg, "edit")
? "Item chosen", i
? "Result of edit ", s


See Also: AppendDialog() CreateDialog() DialogBox() ModalDialog()

Online resources provided by: http://www.X-Hacker.org --- NG 2 HTML conversion by Dave Pearson