MickTheBelgian
Programmer
I would like a fast routine to save the state of my controls to the registry. I had thought of something like this in a module:
-------------------------------------------------------
Public Sub SaveControl(Contr As Control)
SaveSetting App.EXEName, Contr.Parent.Name, Contr.Name, Contr.Value
End Sub
Public Sub LoadControl(Contr As Control)
Contr.Value = GetSetting(App.EXEName, Contr.Parent.Name, Contr.Name, Contr.Value)
End Sub
-------------------------------------------------------
and in my usercontrol a checkbox with:
Private Sub chkSimulate_Click()
ApiCalls.SaveControl (chkSimulate)
End Sub
I seem to be passing the default values of the controls instead of a reference to the control itself. Obviously I get a "Mismatch" error. Any ideas?
-------------------------------------------------------
Public Sub SaveControl(Contr As Control)
SaveSetting App.EXEName, Contr.Parent.Name, Contr.Name, Contr.Value
End Sub
Public Sub LoadControl(Contr As Control)
Contr.Value = GetSetting(App.EXEName, Contr.Parent.Name, Contr.Name, Contr.Value)
End Sub
-------------------------------------------------------
and in my usercontrol a checkbox with:
Private Sub chkSimulate_Click()
ApiCalls.SaveControl (chkSimulate)
End Sub
I seem to be passing the default values of the controls instead of a reference to the control itself. Obviously I get a "Mismatch" error. Any ideas?