次の方法で共有


IXRListBox::GetSelectedItems (Compact 2013)

3/28/2014

This method retrieves the list of currently selected items for this list box control.

Syntax

virtual HRESULT STDMETHODCALLTYPE GetSelectedItems(
    __out IXRList** ppValue
) = 0;

Parameters

  • ppValue
    [out] Pointer to a pointer to an IXRList object that contains the selected item or items. The default value is null.

Return Value

Returns an HRESULT that indicates success or failure.

Remarks

To specify whether the list box allows multiple selections, use the IXRListBox::SetSelectionMode method.

For a multiple-selection list box, the IXRListBox::GetSelectedItems method returns a list that contains the selected items.

For a single-selection list box, the IXRListBox::GetSelectedItems method returns a list that contains only the selected item.

Alternatively, for a single-selection list box, you can retrieve the selected item by using the IXRSelector::GetSelectedItem method or the index of the selected item by using the IXRSelector::GetSelectedIndex method.

.NET Framework Equivalent

System.Windows.Controls.ListBox.SelectedItems

Requirements

Header

XamlRuntime.h

sysgen

SYSGEN_XAML_RUNTIME

See Also

Reference

IXRListBox