Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C#
  4. CheckBox Control

CheckBox Control

Scheduled Pinned Locked Moved C#
5 Posts 4 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • C Offline
    C Offline
    ChennaiBabu
    wrote on last edited by
    #1

    I will tell clearly my doubt here.When selecting the check box,i've to visible 2 text boxes.For that i need the code.Can any of you give me the code.

    Babu

    N C 2 Replies Last reply
    0
    • C ChennaiBabu

      I will tell clearly my doubt here.When selecting the check box,i've to visible 2 text boxes.For that i need the code.Can any of you give me the code.

      Babu

      N Offline
      N Offline
      Nader Elshehabi
      wrote on last edited by
      #2

      Hello Handle the CheckedChanged event, then this:

      ///////////////////////////////////////////
      //Welome to English2C# translation script//
      ///////////////////////////////////////////

      private void MyCheckBox_CheckedChanged(object sender, EventsArgs e)
      {
      if(MyCheckBox.Checked)
      {
      MyTextBoxA.Visible = true;
      MyTextBoxB.Visible = true;
      }
      else
      {
      MyTextBoxA.Visible = false;
      MyTextBoxB.Visible = false;
      }
      }

      That's it!:-D So, where is the question now??:-> Regards:rose: -- modified at 7:30 Wednesday 23rd August, 2006

      W 1 Reply Last reply
      0
      • N Nader Elshehabi

        Hello Handle the CheckedChanged event, then this:

        ///////////////////////////////////////////
        //Welome to English2C# translation script//
        ///////////////////////////////////////////

        private void MyCheckBox_CheckedChanged(object sender, EventsArgs e)
        {
        if(MyCheckBox.Checked)
        {
        MyTextBoxA.Visible = true;
        MyTextBoxB.Visible = true;
        }
        else
        {
        MyTextBoxA.Visible = false;
        MyTextBoxB.Visible = false;
        }
        }

        That's it!:-D So, where is the question now??:-> Regards:rose: -- modified at 7:30 Wednesday 23rd August, 2006

        W Offline
        W Offline
        wheelerbarry
        wrote on last edited by
        #3

        or even simpler /////////////////////////////////////////// //Welome to English2C# translation script// /////////////////////////////////////////// private void MyCheckBox_CheckedChanged(object sender, EventsArgs e) { MyTextBoxB.Visible = MyTextBoxA.Visible = MyCheckBox.Checked; }

        N 1 Reply Last reply
        0
        • C ChennaiBabu

          I will tell clearly my doubt here.When selecting the check box,i've to visible 2 text boxes.For that i need the code.Can any of you give me the code.

          Babu

          C Offline
          C Offline
          Christian Graus
          wrote on last edited by
          #4

          I guess telling you to set the Visible property on a textbox wasn't clear enough for you ?

          Christian Graus - Microsoft MVP - C++ Metal Musings - Rex and my new metal blog

          1 Reply Last reply
          0
          • W wheelerbarry

            or even simpler /////////////////////////////////////////// //Welome to English2C# translation script// /////////////////////////////////////////// private void MyCheckBox_CheckedChanged(object sender, EventsArgs e) { MyTextBoxB.Visible = MyTextBoxA.Visible = MyCheckBox.Checked; }

            N Offline
            N Offline
            Nader Elshehabi
            wrote on last edited by
            #5

            Hey!! I like fancy long codes!:cool: Regards:rose:

            1 Reply Last reply
            0
            Reply
            • Reply as topic
            Log in to reply
            • Oldest to Newest
            • Newest to Oldest
            • Most Votes


            • Login

            • Don't have an account? Register

            • Login or register to search.
            • First post
              Last post
            0
            • Categories
            • Recent
            • Tags
            • Popular
            • World
            • Users
            • Groups