ListBox.SelectAll Metode

Definisi

Memilih semua item dalam kontrol ListBox .

public:
 virtual void SelectAll() = SelectAll;
void SelectAll();
public void SelectAll();
function selectAll()
Public Sub SelectAll ()

Contoh

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();
}
If listBox.SelectionMode <> SelectionMode.Single Then
    listBox.SelectAll()
End If

Keterangan

Peringatan

Metode SelectAll hanya boleh dipanggil saat properti SelectionMode diatur ke Multiple atau Extended. Jika SelectAll dipanggil saat SelectionMode adalah Tunggal, pengecualian akan dilemparkan.

Berlaku untuk