checkbox checked change event question

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!
 
G

Guest

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
 
T

Teemu Keiski

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,983
Messages
2,570,187
Members
46,747
Latest member
jojoBizaroo

Latest Threads

Top