PIbd-32_Turner_I.A._COP_10/COP/WinForms/Form1.cs
2023-09-15 21:10:27 +04:00

53 lines
1.1 KiB
C#

namespace WinForms
{
public partial class Form1 : Form
{
List<string> list = new List<string>();
public Form1()
{
list = new List<string>();
list.AddRange(new string[] { "õëåá", "ìîëîêî", "êîëáàñà" });
InitializeComponent();
dropDownList.LoadValues(new List<string>() { "ñîê", "ÿáëîêî", "ëóê" });
emailTextBox.Pattern = @"^([\w\.\-]+)@([\w\-]+)((\.(\w){2,3})+)$";
}
private void buttonAdd_Click(object sender, EventArgs e)
{
dropDownList.LoadValues(list);
}
private void buttonInfo_Click(object sender, EventArgs e)
{
labelInfo.Text = dropDownList.SelectedValue;
}
private void buttonClear_Click(object sender, EventArgs e)
{
dropDownList.Clear();
}
private void buttonSetExample_Click(object sender, EventArgs e)
{
if (textBoxExample.Text == String.Empty)
{
return;
}
emailTextBox.setExample(textBoxExample.Text);
}
private void buttonShow_Click(object sender, EventArgs e)
{
try
{
if (emailTextBox.TextBoxValue != null)
{
labelShow.Text = "ïîäõîäèò";
}
}
catch (Exception ex)
{
MessageBox.Show(ex.Message);
}
}
}
}