PDA

View Full Version : Trouble with enabling buttons



kmartin7
08-18-2004, 06:27 PM
I want to enable buttons once the first button is pushed. I write a registry key so that if the application is launched again, it will enable all the buttons. I am setting and getting proper values in the registry, but for some reason, I cannot set the buttons to enabled from reading the registry. Here is the code on the first button:

Audio.Stop(CHANNEL_BACKGROUND)
File.OpenURL("http://forums.docsoft.com", SW_SHOWNORMAL);
Button.SetEnabled("adobe", true);
Button.SetEnabled("install", true);
Button.SetEnabled("documentation", true);
Button.SetEnabled("website", true);
Registry.SetValue(HKEY_CURRENT_USER, "Software\\DocSoft Quick.SVG Autorun", "Registered", "EnableBtns", REG_SZ);

Here is the start up code:

registry_value = Registry.GetValue(HKEY_CURRENT_USER, "Software\\DocSoft Quick.SVG Autorun", "Registered", true);
Dialog.Message("Registry Data", "The value read from the Registry is "..registry_value..".");
if (registry_value == "EnableBtns") then
Dialog.Message("Set Enabled", "Button state IS true");
Button.SetVisible("adobe", true);
Button.SetEnabled("adobe", true);
Button.SetEnabled("install", true);
Button.SetEnabled("documentation", true);
Button.SetEnabled("website", true);
end

Any ideas?

Thanks,

Kurt

TJ_Tigger
08-18-2004, 06:50 PM
Kurt,

Is your startup code, placed on the On Show or On Preload events for the page that contains the buttons?

Tigg

kmartin7
08-18-2004, 07:20 PM
It is placed in the On Startup event.

TJ_Tigger
08-18-2004, 10:02 PM
It is placed in the On Startup event.

Try placing the code on the On Preload event for the page. See if that works.