This commit is contained in:
GokaPek 2024-09-16 00:08:22 +04:00
parent d2cbf15038
commit c3fcd0c80d

View File

@ -1,3 +1,6 @@
using Library14Petrushin.Classes;
using Library14Petrushin;
namespace ExecForm namespace ExecForm
{ {
public partial class Form1 : Form public partial class Form1 : Form
@ -5,6 +8,32 @@ namespace ExecForm
public Form1() public Form1()
{ {
InitializeComponent(); InitializeComponent();
// Íàñòðîéêà êîìïîíåíòîâ
chooseList1.AddItemToList("Item 1");
chooseList1.AddItemToList("Item 2");
chooseList1.AddItemToList("Item 3");
textBoxRange1.MinLength = 3;
textBoxRange1.MaxLength = 10;
var hierarchy = new List<string> { "Department", "Position", "FullName" };
var alwaysNewBranch = new Dictionary<string, bool> { { "FullName", true } };
hierarchicalTreeView1.SetHierarchy(hierarchy, alwaysNewBranch);
var employees = new List<Employee>
{
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());
}
} }
} }
} }