ListBox
Introduction
Code Example: Adding a ListBox
var listBox = new ListBox();
listBox.AddToRoot();
listBox.X = 50;
listBox.Y = 50;
listBox.Width = 400;
listBox.Height = 200;
var button = new Button();
button.AddToRoot();
button.X = 50;
button.Y = 270;
button.Text = "Add to ListBox";
button.Click += (s, e) =>
{
var newItem = $"Item {listBox.Items.Count} @ {DateTime.Now}";
listBox.Items.Add(newItem);
listBox.ScrollIntoView(newItem);
};
Items

Adding ListBoxItems to Items

Selection
Reordering With Drag+Drop

Customizing with VisualTemplate
Customizing Displayed Property with ListBoxItemFormsType

Last updated
Was this helpful?

