次の方法で共有


IXRListBox (Windows Embedded CE 6.0)

1/6/2010

This class represents a control that contains a list of selectable items.

Syntax

class IXRListBox : public IXRSelector

Methods

Method Description

IXRListBox::GetItemContainerStyle

Retrieves the style that is used when Silverlight for Windows Embedded renders the item containers.

IXRListBox::ScrollIntoView

Causes the object to scroll into view.

IXRListBox::SetItemContainerStyle

Sets the style that is used when Silverlight for Windows Embedded renders the item containers.

Remarks

IXRListBox contains a collection of items. More than one item in a list box is visible. IXRListBox inherits from IXRItemsControl, and you can retrieve its IXRItemCollection object by calling IXRItemsControl::GetItems. The items collection stores each object that represents a selectable item that is displayed in the list. Items in this collection can be IXRListBoxItem objects, or other types of objects such as IXRTextBlock, IXRButton, or IXRShape objects.

The IXRListBox methods enable you to define a visual appearance for the items in the list by supplying an IXRStyle object for this list box.

The attached properties ScrollViewer.HorizontalScrollBarVisibility and ScrollViewer.VeritcalScrollBarVisibility are used to indicate whether a vertical or horizontal scrollbar should be displayed so that the user can scroll the list. They can be set to either true or false. This is ideal if only some items in the list are visible in the graphical window at a time and you want to provide a scrollbar. To set an attached property, you can use the inherited method IXRDependencyObject::SetAttachedProperty.

You can define visual behaviors for list-box items that are triggered when the MouseEnter, MouseLeave, GotFocus, or MouseLeftButtonDown event is raised by each item. To do this, you can create a storyboard animation and call its IXRStoryboard::Begin method from inside the event handler for each item in the collection. For more information, see IXRStoryboard and IXRTimelineCollection. To define a visual behavior that is triggered when the OnLoad event is raised, you can add an event trigger by calling the inherited method IXRFrameworkElement::GetTriggers and then adding to the trigger collection for the IXRListBox object, or for the IXRListBoxItem objects in its item collection.

You can also define a list box in Microsoft Silverlight 2 XAML. For information about the differences between XAML in Silverlight for Windows Embedded and Silverlight 2, see Differences Between Silverlight for the Web and Silverlight for Windows Embedded. For more information about how to define this element in the source XAML for your application, see this Microsoft Web site.

Inheritance Hierarchy

IXRDependencyObject

    IXRUIElement

        IXRFrameworkElement

            IXRControl

                IXRItemsControl

                    IXRSelector

                        IXRListBox

.NET Framework Equivalent

System.Windows.Controls.ListBox

Requirements

Header XamlRuntime.h
sysgen SYSGEN_XAML_RUNTIME
Windows Embedded CE Windows Embedded CE 6.0 R3

See Also

Reference

Classes for UI Element Management

Other Resources