user3483317
user3483317

Reputation: 157

I would like to trigger an event when a checkbox is clicked

Private Sub ShowPasswordButton_CheckedChanged(sender As Object, e As EventArgs) Handles ShowPasswordButton.CheckedChanged
    If ShowPasswordButton.Checked = True Then
        NewPassword.TextMode = TextBoxMode.SingleLine
    Else
        NewPassword.TextMode = TextBoxMode.Password
    End If
End Sub

I am trying to change text appearance when the box is checked, but checking the box does nothing. It doesn't trigger the event at all. I have this placed in the right spot and I would assume that it should run, but it isn't.

Upvotes: 0

Views: 620

Answers (1)

Sam
Sam

Reputation: 2917

You should have the AutoPostBack="True" property in your checkbox to trigger a server side event.

Upvotes: 1

Related Questions