29. C # The properties and events of the checkbox for multiple marquee checkboxes

Source: Internet
Author: User

In C # , the multi-box component is:checkbox. As with the radio box, it is also a relatively common component.

The main properties of the Multi box are:Name,Text,Checked.

The Name property represents the names of this component. the Text property represents the title of this component. Checked Indicates whether this component is already selected.

The main event is the checkedchanged event.

For example: Choose multiple choices of your personal interests and hobbies. The relevant effects and code are as follows:

void checkbox1checkedchanged(Objectsender,EventArgse)
        {
            if(CheckBox1. Checked)
            {
                TextBox1.AppendText(CheckBox1. text+"\ n");
            }
        }
        void checkbox2checkedchanged(Objectsender,EventArgse)
        {
            if(CheckBox1. Checked)
            {
                TextBox1.AppendText(CheckBox2. text+"\ n");
            }
        }
        void checkbox3checkedchanged(Objectsender,EventArgse)
        {
            if(CheckBox3. Checked)
            {
                TextBox1.AppendText(CheckBox3. text+"\ n");
            }
        }
        void checkbox4checkedchanged(Objectsender,EventArgse)
        {
            if(checkBox4. Checked)
            {
                TextBox1.AppendText(checkBox4. text+"\ n");
            }
        }

650) this.width=650; "Src=" https://s5.51cto.com/wyfs02/M00/08/AB/wKiom1nlo6LCquiyAAA3cO4Kosc379.png-wh_500x0-wm_ 3-wmp_4-s_3536624679.png "title=" 1.png "alt=" Wkiom1nlo6lcquiyaaa3co4kosc379.png-wh_50 "/>


29. C # The properties and events of the checkbox for multiple marquee checkboxes

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.