From c3fcd0c80de6b948f09e6d8640f4c947f336778c Mon Sep 17 00:00:00 2001 From: GokaPek Date: Mon, 16 Sep 2024 00:08:22 +0400 Subject: [PATCH] 5 --- ExecForm/Form1.cs | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) diff --git a/ExecForm/Form1.cs b/ExecForm/Form1.cs index ff47a8c..61e1daa 100644 --- a/ExecForm/Form1.cs +++ b/ExecForm/Form1.cs @@ -1,3 +1,6 @@ +using Library14Petrushin.Classes; +using Library14Petrushin; + namespace ExecForm { public partial class Form1 : Form @@ -5,6 +8,32 @@ namespace ExecForm public Form1() { InitializeComponent(); + + + // Настройка компонентов + chooseList1.AddItemToList("Item 1"); + chooseList1.AddItemToList("Item 2"); + chooseList1.AddItemToList("Item 3"); + + textBoxRange1.MinLength = 3; + textBoxRange1.MaxLength = 10; + + var hierarchy = new List { "Department", "Position", "FullName" }; + var alwaysNewBranch = new Dictionary { { "FullName", true } }; + hierarchicalTreeView1.SetHierarchy(hierarchy, alwaysNewBranch); + + var employees = new List + { + new Employee { Department = "IT", Position = "Developer", FullName = "John Doe" }, + new Employee { Department = "HR", Position = "Manager", FullName = "Jane Smith" } + }; + + // Заполнение дерева с использованием AddObjectToTree + foreach (var employee in employees) + { + hierarchicalTreeView1.AddObjectToTree(employee, hierarchy.Last()); + } + } } }