次の方法で共有


IXRListBox::ScrollIntoView (Compact 2013)

3/28/2014

This method causes an object to scroll into view in the list box.

Syntax

virtual HRESULT STDMETHODCALLTYPE ScrollIntoView(
    __in XRValue* pItem
) = 0;

Parameters

  • pItem
    [in] Pointer to the XRValue object to scroll to.

Return Value

Returns an HRESULT that indicates success or failure.

Remarks

You can provide an IXRListBoxItem object as the value of pItem by using the XRValue::SetValue(IXRDependencyObject, bool) method. Alternatively, you can use an IXRDependencyObject pointer for pItem as shown in the following example, where pListBox is a pointer to an IXRListBox object, pCollection is a pointer to a pointer to an IXRItemCollection object, and pDO is an IXRDependencyObject pointer:

pListBox->GetItems( &pCollection );
pCollection->GetItem( index, &pDO );
pListBox->ScrollIntoView( pDO );

As illustrated in this code fragment, the collection of items in an IXRListBox is stored in an IXRItemCollection object.

To use a specific interface pointer type, you can use the template version of this method that XAML for Windows Embedded provides. When you supply a derived type, this version automatically supplies a type-safe method that implicitly converts the returned type from a generic interface. This means you do not have to explicitly call QueryInterface to convert the generic interface into the required object type.

.NET Framework Equivalent

System.Windows.Controls.ListBox.ScrollIntoView

Requirements

Header

XamlRuntime.h

sysgen

SYSGEN_XAML_RUNTIME

See Also

Reference

IXRListBox