namespace Forms { public partial class Form : System.Windows.Forms.Form { public Form() { InitializeComponent(); FillBox(); FillTextBox(); FillGrid(); } private void FillBox() { controlComboBox.elements = "Значение 1, Значение 2, Значение 3, Значение 4"; } private void FillTextBox() { controlTextBox.text = "+79063908075"; } private void FillGrid() { List headers = new List() { "Id", "Имя" }; List width = new List() { 200, 200 }; List isVisible = new List() { true, true }; List props = new List() { "Id", "Name" }; controlDataGrid.CreateColumns(2, headers, width, isVisible, props); } private void controlComboBox_ComboBoxChanged(object sender, EventArgs e) { var elem = controlComboBox.elements; MessageBox.Show($"Выбранно: {elem}"); } private void controlTextBox_CheckBoxChanged(object sender, EventArgs e) { if (controlTextBox.text == null) { MessageBox.Show($"CheckBox checked"); } else { MessageBox.Show($"CheckBox not checked"); } } private void buttonGetObj_Click(object sender, EventArgs e) { var da = controlDataGrid.GetObject(); MessageBox.Show($"{da?.Id}:{da?.Name} "); } private void buttonClear_Click(object sender, EventArgs e) { controlDataGrid.ClearData(); } } }