PDA

View Full Version : Setting Radio Button Checked status


heelism
10-22-2008, 08:24 AM
Hi

I am trying to set a radio button on a custom screen so that it is checked but nothing seems to be happening.

I have the following code in the "On Preload" code section:
DlgRadioButton.SetProperties(CTRL_RADIO_BUTTON_01, {Checked = true});

Cheers,

Martin

upeters
10-22-2008, 08:54 AM
The same code you posted works fine for me, the correct radiobutton was checked. You could post your project file to help find the error.

Ulrich

jassing
10-22-2008, 02:32 PM
Hi

I am trying to set a radio button on a custom screen so that it is checked but nothing seems to be happening.

I have the following code in the "On Preload" code section:
DlgRadioButton.SetProperties(CTRL_RADIO_BUTTON_01, {Checked = true});

Cheers,

Martin

are you sure the radio button CTRL_RADIO_BUTTON_01 and not another button?

They are not necessarily #'d from "top to bottom" they are #'d in the order that you placed them -- and if you put 3 down; and removed the 1st, there would be no #1 radio button....

heelism
10-23-2008, 11:17 AM
I had quotes around the CTRL_RADIO_BUTTON_01 in my code and didn't notice :-(

All working now. Strange that an error message wasn't reported. Looks like the syntax checking needs work...

jassing
10-23-2008, 11:24 AM
I had quotes around the CTRL_RADIO_BUTTON_01 in my code and didn't notice :-(

All working now. Strange that an error message wasn't reported. Looks like the syntax checking needs work...

In the future, you should generally post your actual code, not retyped or made up code...


I have the following code in the "On Preload" code section:
DlgRadioButton.SetProperties(CTRL_RADIO_BUTTON_01, {Checked = true});

doesn't show any quotes around it... neither of us saw any issues with it.

Glad you got it figured out.