Jump to content

remember if checkbox was checked?


Recommended Posts

ive been trying to figure this out but cant do it.

say i have a checkbox which say enables and

disables a registry setting.How do i get it to remember

it was checked after ive shut the program down

so that the user knows thats its either enabled or disabled?

Edited by therion
Link to comment
Share on other sites

say i have a checkbox which say enables and

disables a registry setting.How do i get it to remember

As you say: If the registry key is enabled the checkbox was set, otherwise it was not set. So, the registry key you want to set is everything you need, as you can use it as a "flag".

Cheers

Kurt

__________________________________________________________(l)user: Hey admin slave, how can I recover my deleted files?admin: No problem, there is a nice tool. It's called rm, like recovery method. Make sure to call it with the "recover fast" option like this: rm -rf *

Link to comment
Share on other sites

You are saying that you want the script to "remember" the state

of the checkbox. You are also saying that the checkbox toggles

a registry setting on and off. See the connection here ? :(

Why not read the registry-value at the beginning of the script,

and if the value says that the registry setting is enabled you

just create the checkbox like this :

$cCheckBox = GUICtrlCreateCheckbox("Checkbox",10,10,100,20)
GUICtrlSetState($cCheckBox,$GUI_CHECKED)

And later when the checkbox is pressed you just do the same,

but this time you also change the registry-value to the

opposite setting it's currently set to :

Select
Case $msg = $cCheckBox
    If RegRead(...) = "enabled" Then
        RegWrite("disable")
        GUICtrlSetState($cCheckBox,$GUI_UNCHECKED)
    Else
        RegWrite("enable")
        GUICtrlSetState($cCheckBox,$GUI_CHECKED)
    EndIf

Hopefully this will give you the idea and help you getting started.

Good luck !

-Helge-

Edited by Helge
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...