123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263 |
- 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 KazarinPractica03
- {
- public partial class Form4 : Form
- {
- public Form4()
- {
- InitializeComponent();
- // задаем обработчик события
- linkLabel1.LinkClicked += linkLabel1_LinkClicked;
- AutoCompleteStringCollection source = new AutoCompleteStringCollection()
- {
- "Кузнецов",
- "Иванов",
- "Петров",
- "Кустов"
- };
- textBox2.AutoCompleteCustomSource = source;
- textBox2.AutoCompleteMode = AutoCompleteMode.SuggestAppend;
- textBox2.AutoCompleteSource = AutoCompleteSource.CustomSource;
- textBox4.TextChanged += textBox4_TextChanged;
-
- }
- private void linkLabel1_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
- {
- System.Diagnostics.Process.Start("http://metanit.com");
- }
- private void textBox4_TextChanged(object sender, EventArgs e)
- {
- label4.Text = textBox4.Text;
- }
-
- private void Form4_Load(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 + " теперь не отмечен");
- }
- }
- }
- }
|