using System.Collections.Generic; using WinFormsLibrary; using WinFormsLibrary.Object; namespace WinForms { public partial class FormComponents : Form { List list = new List(); List clients = new List(); public FormComponents() { list = new List(); list.AddRange(new string[] { "привет", "пока", "бб" }); Client client1 = new Client("Сергей", "нет", "Идиот", 3); Client client2 = new Client("Давид", "да-11", "Гений", 1); Client client3 = new Client("Руслан", "Асу", "Летальный", 4); clients.Add(client1); clients.Add(client2); clients.Add(client3); InitializeComponent(); dropDownList.LoadValues(new List() { "чего", "забей", "пример" }); emailTextBox.Pattern = @"^([\w\.\-]+)@([\w\-]+)((\.(\w){2,3})+)$"; listBoxValues.SetLayout("ФИО [FIO] Обзор [Review] Статус [Status] сумма [Sum]", "[", "]"); dropDownList.ValueChanged += CustomEventHandler; } private void CustomEventHandler(object sender, EventArgs e) { MessageBox.Show("Хрю"); } private void buttonAdd_Click(object sender, EventArgs e) { dropDownList.LoadValues(list); } private void buttonInfo_Click(object sender, EventArgs e) { labelInfo.Text = dropDownList.Selected; } 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) { labelEmail.Text = emailTextBox.TextBoxValue; } } catch (Exception ex) { MessageBox.Show(ex.Message); } } private void buttonShowItem_Click(object sender, EventArgs e) { string str = listBoxValues.GetObjectFromStr().FIO + " " + listBoxValues.GetObjectFromStr().Review + " " + listBoxValues.GetObjectFromStr().Status + " " + listBoxValues.GetObjectFromStr().Sum; labelShowInput.Text = str; } private void buttonAddValues_Click(object sender, EventArgs e) { listBoxValues.AddInListBox(clients); } } }