PDA

View Full Version : Set RADIO buttons based on VARIABLE???


Joshua
02-16-2005, 03:57 AM
I have set the default radio button within a project to CTRL_RADIO_BUTTON_01, but I want to know how I can set it based on a registry lookup value. This may meen that it is button 1 or button 11 as the default.

So far I have the following:
ON STARTUP
NoRegistryMidi = true;
RegMidi = Registry.GetValue(HKEY_LOCAL_MACHINE, "Software\\Company\\Product\\1.0", "Midi", true);
if (RegMidi ~= "") then
NoRegistryMidi = false;
if (RegMidi == "name of midi 1") then
DefaultMidi = 1;
end
if (RegMidi == "name of midi 2") then
DefaultMidi = 2;
end
end

If the test represented button 2 as being used last time the user run the program, then I would like to set the CTRL_RADIO_BUTTON_02 as the default on the radio buttons screen.

Thanks
Joshua

Joshua
02-16-2005, 09:02 AM
The answer was quite simple...

Radio Buttons --> ACTIONS --> ON PRELOAD
if (DefaultMidi == 2) then
DlgRadioButton.SetProperties(CTRL_RADIO_BUTTON_02, {Checked = true});
end

You will need to set the default to NONE.

Radio Buttons --> SETTINGS --> DEFAULT SELECTION
NONE

Oh well, on with the show.

Man this is definately the most powerful version yet. Go you good thing.

Joshua