mirror of
https://github.com/colhountech/DarkUI.Net5.git
synced 2025-07-02 07:09:27 +03:00
50 lines
1.5 KiB
C#
50 lines
1.5 KiB
C#
using DarkUI;
|
|
|
|
namespace Example
|
|
{
|
|
public partial class MainForm : DarkForm
|
|
{
|
|
public MainForm()
|
|
{
|
|
InitializeComponent();
|
|
|
|
// Build dummy list data
|
|
for (var i = 0; i < 100; i++)
|
|
{
|
|
var item = new DarkListItem(string.Format("List item #{0}", i));
|
|
darkListView1.Items.Add(item);
|
|
}
|
|
|
|
// Build dummy nodes
|
|
var childCount = 0;
|
|
for (var i = 0; i < 20; i++)
|
|
{
|
|
var node = new DarkTreeNode(string.Format("Root node #{0}", i));
|
|
node.ExpandedIcon = Icons.folder_open;
|
|
node.Icon = Icons.folder_closed;
|
|
|
|
for (var x = 0; x < 10; x++)
|
|
{
|
|
var childNode = new DarkTreeNode(string.Format("Child node #{0}", childCount));
|
|
childNode.Icon = Icons.files;
|
|
childCount++;
|
|
node.Nodes.Add(childNode);
|
|
}
|
|
|
|
darkTreeView1.Nodes.Add(node);
|
|
}
|
|
|
|
// Hook dialog button events
|
|
btnDialog.Click += delegate
|
|
{
|
|
DarkMessageBox.ShowError("This is an error", "Dark UI - Example");
|
|
};
|
|
|
|
btnMessageBox.Click += delegate
|
|
{
|
|
DarkMessageBox.ShowInformation("This is some information, except it is much bigger, so there we go. I wonder how this is going to go. I hope it resizes properly. It probably will.", "Dark UI - Example");
|
|
};
|
|
}
|
|
}
|
|
}
|