Reputation: 2350
I have a button on my form that I would like to hide permanently if the box is checked. In other words, if the user checks the box, the next time the form shows up, the button should not show up.
I would think that I have to capture the check event on the main form load event and store that somehow, but I am not sure how to that.
I wrote the following, but when the forms loads again, the button shows up.
Private Sub hideMe_CheckedChanged(sender As Object, e As EventArgs) Handles hideMe.CheckedChanged
If hideMe.Checked = True Then
frmRegistration.Show()
hideMe.Enabled = False
End If
End Sub
Upvotes: 0
Views: 67
Reputation: 38905
You need to save something as a setting or such and reload it each time the app starts (guessing at names and functionality):
Form Load maybe:
If My.Settings.IsRegistered = True Then
btnRegister.Visible = False
chkSomething.Checked = True
End If
Upvotes: 1