Hello i got a question if someone can help me out.
I have 1 checkbox named "enablelogs"
And i want to make log file when there is changed option to save it to the file.
And my problem is this.
When the form opens and the checkbox is already checked then when i press the button save to save information to file , to skip it because its already checked.
What i want to to?
- If checkbox is already checked when press button to skip
- If checkbox was changed from checked to unchecked and press button to save the information
- If checkbox was changed to unchecked and again checked to save it again.
Here is my code:
Private Sub btnSave_Click(sender As Object, e As EventArgs) Handles btnSave.Click
If enableLogs.Checked = True Then
Logger.log("[Admin Name: " & lblGetName.Text & "]" & " Changed Option" & " " & "Enable Logs")
Else
Logger.log("[Admin Name: " & lblGetName.Text & "]" & " Changed Option" & " " & "Disable Logs")
End If
and here is what it saves everytime in file:
[10:21:56][Admin Name: admin] Changed Option Enable Logs
How to do it if everytime is changed to save, not to dublicate the information in save.
For example if the checkbox is already checked when form load and then i press the button not to display me in log this:
[10:21:56][Admin Name: admin] Changed Option Enable Logs
Any ideas i will appreciate
What I have tried:
i had tryed with button to make saves and also in
enableLogs_CheckedChanged
The results is the same