28. RadioButton properties and events of the radio box inside C #

Source: Internet
Author: User

In the C # language, the properties of a radio box are really similar to other programming languages.

The main attributes are:Name,Text. The main thing is:checkedchanged.

For example: Create a simple example, choose Spring and Autumn. You can simply select the RadioButton component and pull out 4 boxes on top of the window . Then, modify the Text Property individually: Spring, summer, autumn, winter. Interface such as:

650) this.width=650; "Src=" https://s4.51cto.com/wyfs02/M00/08/92/wKiom1nkVBDivQA_AAATuAkoCFA543.png-wh_500x0-wm_ 3-wmp_4-s_874568319.png "title=" 1.png "alt=" Wkiom1nkvbdivqa_aaatuakocfa543.png-wh_50 "/>


Next, you can set the checkedchanged event for each radio box component separately .

The code is as follows:

        void radiobutton1checkedchanged(Objectsender,EventArgse)
        {
            MessageBox.Show(RadioButton1. Text);
        }
        void radiobutton2checkedchanged(Objectsender,EventArgse)
        {
            MessageBox.Show(RadioButton2. Text);
        }
        void radiobutton3checkedchanged(Objectsender,EventArgse)
        {
            MessageBox.Show(RadioButton3. Text);
        }
        void radiobutton4checkedchanged(Objectsender,EventArgse)
        {
            MessageBox.Show(RadioButton4. Text);
        }



This article is from the "Smile" blog, please be sure to keep this source http://yiyiweixiao.blog.51cto.com/2476874/1972801

28. RadioButton properties and events of the radio box inside C #

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.