When I have a group of radiobuttons I've never had a problem with turning them on/off with the mouse.
I click one; it is turned on and all others in the group are turned off
However, when I use the SETSTATE command to turn a radiobutton on it does not turn any others off in the group.
I have to add SETSTATE commands for every radiobutton and turn them all off and the desired one on.
The attached example rb1.iwb shows what happens if you use just the one SETSTATE command at a time to turn on the desired rb.
(Each of the 3 buttons turns on the associated radiobutton.)
There's a windows API that fixes that:CheckRadioButton
The parameters that are passed are:
handle of parent window,
id of first rb in group,
id of last rb in group,
rb to turn on
The attached example rb2 shows the api function in action
Hi Larry,
The same problem occurs when using CHECKBOX, you have to manually turn them all off and turn on the desired one.
Do you know if there is a Windows API for checkboxes as well?
Andy.
If you change the radio buttons in the rb2 example to checkboxes it works with them too!
Andy.
:)
Quote from: andy1966 on September 13, 2013, 10:31:43 PM
If you change the radio buttons in the rb2 example to checkboxes it works with them too!
Andy.
:)
Checkboxes are normally used in an exclusive or arrangement but that is nice to know.