Поделиться через


IXRSelector::SetSelectedItem (Compact 2013)

3/28/2014

This method sets the selected item in the collection.

Syntax

virtual HRESULT STDMETHODCALLTYPE SetSelectedItem(
    __in XRValue *SelectedItem
) = 0;

Parameters

  • SelectedItem
    [in] Pointer to an XRValue object that indicates the selected item in the collection.

Return Value

Returns an HRESULT that indicates success or failure.

Returns XR_E_INVALID_OBJECT if SelectedItem does not represent a XAML for Windows Embedded object.

Remarks

The combo box, which inherits from IXRSelector, does not allow more than one item to be selected at a time.

Use the IXRSelector::SetSelectedIndex or IXRSelector::SetSelectedItem method to set the selected item from application code.

To use any supported value type, such as a float value, you can use the helper template version of this method that XAML for Windows Embedded provides. When you supply a value type, this version automatically supplies a type-safe method that implicitly converts the returned type from a generic XRValue to the appropriate data type.

.NET Framework Equivalent

System.Windows.Controls.Primitives.Selector.SelectedItem

Requirements

Header

XamlRuntime.h

sysgen

SYSGEN_XAML_RUNTIME

See Also

Reference

IXRSelector
IXRSelector::GetSelectedItem