using System.Security.Cryptography; using VisualComponentsLib.Object; namespace WinForms { public partial class Form1 : Form { List list = new List(); List students = new List(); public Form1() { list = new List(); list.AddRange(new string[] { "хлеб", "молоко", "колбаса" }); Student student1 = new Student("Васильев", "ПИбд-32", "ФИСТ", 3); Student student2 = new Student("Иванов", "РТбд-11", "РТФ", 1); Student student3 = new Student("Смирнова", "ЛМККбд-41", "ГФ", 4); students.Add(student1); students.Add(student2); students.Add(student3); InitializeComponent(); dropDownList.LoadValues(new List() { "сок", "яблоко", "лук" }); emailTextBox.Pattern = @"^([\w\.\-]+)@([\w\-]+)((\.(\w){2,3})+)$"; listBoxObj.SetLayoutInfo("Фамилия *Name* Группа *Group* Факультет *Faculty* Курс *Course*", "*", "*"); } 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); } } private void buttonAddObjects_Click(object sender, EventArgs e) { listBoxObj.AddInListBox(students); } private void buttonShowItem_Click(object sender, EventArgs e) { string str = listBoxObj.GetObjectFromStr().Name + " " + listBoxObj.GetObjectFromStr().Group + " " + listBoxObj.GetObjectFromStr().Faculty + " " + listBoxObj.GetObjectFromStr().Course; labelShowInput.Text = str; } } }