# Checked and Radio Button Menu Items > [HTML Version](checkedandradiobutton.htm) Checked and radio button menu items are created using the [Mtype](mtype.htm.md) flags MBF\_CHKMNU and MBF\_RADIOMNU, as shown in this example from the sample program [ASMNU2 in EXLIB:\[908,35\]](https://bitbucket.org/microsabio/exlib/src/master/908035/asmnu2.bp). (./images/ashref_img166.png) To initialize the state of a checked or radio button menu item to checked (or selected), add the MBST\_CHECKED flag to the [Mstate](mstate.htm.md) parameter, as shown in the example below: xcall AUI, AUI\_MENU, MNUOP\_ADD, id'optmnu, "Option 1", MBST\_ENABLE+MBST\_CHECKED, \& MBF\_CHKMNU,"","",mstatus, dlgid, id’option1 \! checked item xcall AUI, AUI\_MENU, MNUOP\_ADD, id’optmnu, "Option 2", MBST\_ENABLE, \& MBF\_CHKMNU,"","",mstatus, dlgid, id’option2 \! unchecked item xcall AUI, AUI\_MENU, MNUOP\_ADD, id’optmnu, "Radio 1", MBST\_ENABLE+MBST\_CHECKED, \& MBF\_RADIOMNU,"","",mstatus, dlgid, id’radio1 \! selected radio item xcall AUI, AUI\_MENU, MNUOP\_ADD, id’optmnu, "Radio 2", MBST\_ENABLE, \& MBF\_RADIOMNU,"","",mstatus, dlgid, id’radio2 \! unselected radio item In the above code sample, note that the [Itemid](itemid.htm.md) is used to assign unique identifiers to each of the items, and to associate the items with the parent menu _id’optmnu_. Also note that since we didn’t specify anything in the [Cmd](cmd_aui.htm.md) parameter, the items do not do anything on their own when clicked, other than change their state. The application will have to query the items to determine their states as needed (see next). Alternatively, if we wanted to respond immediately with an action corresponding to the change in state of such a menu item, we could have had them generate exitcodes (as in the [Menu Icons](menuicons.htm.md) example above). They can also execute command lines or launch documents (using MBF\_CMDLIN or MBF\_SHLEXC) just like other normal menu items. Querying item state: To query the current state of a checked or radio menu item, use MNUOP\_CHK, identifying the item to query via the parent [Menuid](menuid.htm.md), [Dlgid](dlgid.htm.md), and [Itemid](itemid.htm.md). The current state flags will be returned in the [Mstatus](mstatus.htm.md) parameter, as shown below: xcall AUI, AUI\_MENU, MNUOP\_CHK, id’optmnu, "", 0, 0, "","", mstatus, dlgid, id’option1 If (mstatus and MBST\_CHECKED) ? "Option 1 is checked" xcall AUI, AUI\_MENU, MNUOP\_CHK, id’optmnu, "", 0, 0, "","", mstatus, dlgid, id’radio1 If (mstatus and MBST\_CHECKED) ? "Radio 1 is selected" Changing item state: The states of checked and radio menu items change automatically when clicked. You may also change the state under application control, using MNUOP\_STA. For example, to select the "Radio 2" item in the menu shown above (which will automatically deselect the "Radio 1" item): xcall AUI, AUI\_MENU, MNUOP\_STA, id’optmnu, "Radio 2", MBST\_ENABLE+MBST\_CHECKED, 0, "","", \& mstatus, dlgid, id’radio2