-api-id | -api-type |
---|---|
M:Microsoft.UI.Xaml.Controls.ListBox.SelectAll |
winrt method |
Selects all the items in the ListBox control.
Warning
The SelectAll method should only be called when the SelectionMode property is set to Multiple or Extended. If SelectAll is called when the SelectionMode is Single, an exception is thrown.
if (listBox.SelectionMode != SelectionMode.Single)
{
listBox.SelectAll();
}
if (listBox().SelectionMode() != Windows::UI::Xaml::Controls::SelectionMode::Single)
{
listBox().SelectAll();
}
if (listBox->SelectionMode != SelectionMode::Single)
{
listBox->SelectAll();
}