checkbox checked change event question

  • Thread starter Thread starter Matthew Louden
  • Start date Start date
M

Matthew Louden

For the following code, I dont understand why "no" never appears even I
uncheck the check in the check box.

Private Sub CheckBox1_CheckedChanged(ByVal sender As System.Object, ByVal e
As System.EventArgs) Handles CheckBox1.CheckedChanged
TextBox1.Text = " "
If (CheckBox1.Enabled) Then
TextBox1.Text = "yes"
Else
TextBox1.Text = "no"
End If
End Sub


Please advise. thanks!
 
perhaps you want to look at the chkbox.checked property.
This is the property which tells you if the checkbox is
checked.

if (checkbox1.checked) then
 
You are looking for Enabled property of CheckBox whereas you should look for
Checked property. Checked property is the one that changes when CheckBox is
checked/unchecked.
 
Back
Top