Answered Trouble with three controls

Socarsky

Well-known member
Joined
Dec 27, 2012
Messages
173
Location
Jakarta/Indonesia
Programming Experience
Beginner
I'm in trouble with three controls in a form. All those controls assigned by registry values when form loads. Two of them are CheckBoxes, the other one is a NumberUpDown control and I assigned 5 value to minimum value of the control that means it loads automatically when form calls NumberUpDown's ValueChanged event. So the problem is I can control as half way the three controls by making a button's enable property true or false. I cannot get in touch with a save button's enable condition when they changed as value or checked.
 
Last edited:
I'm not 100% sure what you're saying. Do you mean that you want to be able to react when the user makes changes in those controls but not when you set their initial state at startup?
 
I'm not 100% sure what you're saying. Do you mean that you want to be able to react when the user makes changes in those controls but not when you set their initial state at startup?
 Private Sub chkPromptOnExit_CheckedChanged(sender As Object, e As EventArgs) Handles chkPromptOnExit.CheckedChanged
        If userOption_PromptExit <> chkPromptOnExit.Checked Then
            btnSave.Enabled = True
        End If
    End Sub

    Private Sub chkAllowRunAtStartup_CheckedChanged(sender As Object, e As EventArgs) Handles chkAllowRunAtStartup.CheckedChanged
        If userOption_StartupWindows <> chkAllowRunAtStartup.Checked Then
            btnSave.Enabled = True
        End If
    End Sub

userOptions assigns by form loading each one of them retrieves a registry's value.. and loading event assign them to controls if checked true or assigned before a value for numberUPDown control. I only want to control Save button's enabled property. If any changing occurs by user that setting' options
 
So, you're saying that you want to load the initial values into the controls, disable the Save Button and then, as the user makes changes, enable or disable the Save Button depending on whether there are any differences from those original values; correct?
 
So, you're saying that you want to load the initial values into the controls, disable the Save Button and then, as the user makes changes, enable or disable the Save Button depending on whether there are any differences from those original values; correct?
Yes exactly.. btw, I can read registry's values to assign their controls when the form loads. There is no problem at that phase.
 
In that case, assign the values from the Registry to some fields at startup and then load those field values into the controls. Disable the Button after doing that and then you can simply compare the current values to those fields each time there's a change.
 
you comment is out of my expectation.. I know such that things but the case I mentioned is difference.
 
Back
Top