PIbd-32_Turner_I.A._COP_10/COP/WinForms/Form1.cs

53 lines
1.1 KiB
C#
Raw Normal View History

2023-09-13 18:53:06 +04:00
namespace WinForms
{
public partial class Form1 : Form
{
2023-09-15 19:31:01 +04:00
List<string> list = new List<string>();
2023-09-13 18:53:06 +04:00
public Form1()
{
2023-09-15 19:31:01 +04:00
list = new List<string>();
list.AddRange(new string[] { "<22><><EFBFBD><EFBFBD>", "<22><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>", "<22><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>" });
2023-09-13 18:53:06 +04:00
InitializeComponent();
2023-09-15 19:31:01 +04:00
dropDownList.LoadValues(new List<string>() { "<22><><EFBFBD>", "<22><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>", "<22><><EFBFBD>" });
emailTextBox.Pattern = @"^([\w\.\-]+)@([\w\-]+)((\.(\w){2,3})+)$";
2023-09-15 19:31:01 +04:00
}
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();
2023-09-13 18:53:06 +04:00
}
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 = "<22><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>";
}
}
catch (Exception ex)
{
MessageBox.Show(ex.Message);
}
}
2023-09-13 18:53:06 +04:00
}
}