checkbox checked change event question

Discussion in 'ASP .Net Web Controls' started by Matthew Louden, Nov 18, 2003.

  1. 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!
     
    Matthew Louden, Nov 18, 2003
    #1
    1. Advertising

  2. Matthew Louden

    Teemu Keiski Guest

    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.

    --
    Teemu Keiski
    MCP, Microsoft MVP (ASP.NET), AspInsiders member
    ASP.NET Forum Moderator, AspAlliance Columnist


    "Matthew Louden" <> wrote in message
    news:...
    > 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!
    >
    >
     
    Teemu Keiski, Nov 18, 2003
    #2
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Matthew Louden

    checkbox checked change event question

    Matthew Louden, Nov 18, 2003, in forum: ASP .Net
    Replies:
    2
    Views:
    5,431
    Teemu Keiski
    Nov 18, 2003
  2. yurps
    Replies:
    1
    Views:
    6,990
    rajeshthangarasu1983
    Feb 29, 2008
  3. c_shah
    Replies:
    5
    Views:
    1,163
    CitrusMotors.com
    Jun 15, 2007
  4. JemPower

    Capturing checked event for Template based checkbox.

    JemPower, Oct 30, 2003, in forum: ASP .Net Datagrid Control
    Replies:
    0
    Views:
    189
    JemPower
    Oct 30, 2003
  5. randy
    Replies:
    13
    Views:
    480
    Tad McClellan
    Nov 1, 2003
Loading...

Share This Page