123456789101112131415161718192021222324252627282930313233343536373839404142 |
- using System;
- using System.Collections.Generic;
- using System.ComponentModel;
- using System.Data;
- using System.Drawing;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- using System.Windows.Forms;
- namespace WindowsFormsRadioButton
- {
- public partial class Form1 : Form
- {
- public Form1()
- {
- InitializeComponent();
- }
- private void radioButton2_Click(object sender, EventArgs e)
- {
- if(radioButton2.Checked == true)
- {
- MessageBox.Show("RadioButton2控件被选中");
- }
- }
- private void radioButton1_Click(object sender, EventArgs e)
- {
- if (radioButton1.Checked == true)
- {
- MessageBox.Show("RadioButton1控件被选中");
- }
- }
- private void Form1_Load(object sender, EventArgs e)
- {
- radioButton1.Checked = false;
- radioButton2.Checked = false;
- }
- }
- }
|