1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 |
- 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 Praktika409
- {
- public partial class Form2 : Form
- {
- public Form2()
- {
- InitializeComponent();
- string[] countries = { "Росиия", "Китай", "Индия", "Северная Корея", "Вьетнам" };
- listBox1.Items.AddRange(countries);
- }
- private void checkBox3_CheckedChanged(object sender, EventArgs e)
- {
- }
- private void checkBox1_CheckedChanged(object sender, EventArgs e)
- {
- CheckBox checkBox = (CheckBox)sender; // приводим отправителя к элементу типа CheckBox
- if (checkBox.Checked == true)
- {
- MessageBox.Show("Флажок " + checkBox.Text + " теперь отмечен");
- }
- else
- {
- MessageBox.Show("Флажок " + checkBox.Text + " теперь не отмечен");
- }
- }
- private void radioButton1_CheckedChanged(object sender, EventArgs e)
- {
- // приводим отправителя к элементу типа RadioButton
- RadioButton radioButton = (RadioButton)sender;
- if (radioButton.Checked)
- {
- MessageBox.Show("Вы выбрали " + radioButton.Text);
- }
- }
- }
- }
|