IXRComboBox (Compact 2013)

3/28/2014

This class represents a selection control that combines a non-editable text box and a drop-down list in which users select an item.

Syntax

class IXRComboBox : public IXRSelector

Inheritance Hierarchy

IXRSelector

     IXRComboBox

Methods

Method

Description

IXRComboBox::AddDropDownOpenedHandler

Attaches a delegate to the DropDownOpened event for this combo box. When the combo box raises the DropDownOpened event, this delegate will be invoked.

IXRComboBox::AddDropDownClosedHandler

Attaches a delegate to the DropDownClosed event for this combo box. When the combo box raises the DropDownClosed event, this delegate will be invoked.

IXRComboBox::GetIsDropDownOpen

Retrieves a value that indicates whether the popup part of this combo box is currently open.

IXRComboBox::GetIsEditable

Retrieves a value that indicates whether the user can edit text in the text-box part of this combo box. This method always returns false.

IXRComboBox::GetIsSelectionBoxHighlighted

Retrieves a value that indicates whether the item displayed in the selection box is highlighted.

IXRComboBox::GetItemContainerStyle

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

IXRComboBox::GetMaxDropDownHeight

Retrieves the maximum height of the popup that lists combo-box items.

IXRComboBox::GetSelectionBoxItem

Retrieves the item displayed in the selection box.

IXRComboBox::RemovedDropDownOpenedHandler

Removes a delegate to the DropDownOpened event for this combo box. When the combo box raises the DropDownOpened event, this delegate will be invoked.

IXRComboBox::RemoveDropDownClosedHandler

Removes a delegate to the DropDownClosed event for this combo box. When the combo box raises the DropDownClosed event, this delegate will be invoked.

IXRComboBox::SetIsDropDownOpen

Sets a value that indicates whether the popup part of the combo box is currently open.

IXRComboBox::SetItemContainerStyle

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

IXRComboBox::SetMaxDropDownHeight

Sets the maximum height of the popup that lists combo-box items.

Thread Safety

Members of this class are thread-safe if you previously called IXRApplication::CreateHostFromXaml and supplied it with an XRWindowCreateParams structure that has AllowsMultipleThreadAccess set to true.

Remarks

The text box that belongs to this combo box either displays the current selection or is empty if there is no selected item.

IXRComboBox contains a collection of items. The items are visible in a drop-down menu that is displayed as a popup when it is opened. IXRComboBox 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 displayed in the list. Items in this collection can be IXRComboBoxItem objects.

The method IXRComboBox::SetItemContainerStyle enables you to define a visual appearance for the items in this combo box by supplying an IXRStyle object.

The attached properties ScrollViewer.HorizontalScrollBarVisibility and ScrollViewer.VerticalScrollBarVisibility are used to indicate whether a vertical or horizontal scrollbar should be displayed so that the user can scroll the list in the popup. This is ideal if only some items in the popup are visible in the graphical window and you want to provide a scrollbar. To add scrolling properties, you can add a property setter for one of these attached properties to the IXRStyle object that you supply in the call to SetItemContainerStyle. Or, you can call the inherited method IXRDependencyObject::SetAttachedProperty(const WCHAR*, const WCHAR*, int).

If you are not using a control template for this combo box, you can retrieve the item that is currently displayed in the non-editable text box by calling the inherited method IXRSelector::GetSelectedItem, and you can set the item to display in this text box by calling IXRSelector::SetSelectedItem.

When you create a class instance, use an IXRComboBoxPtr smart pointer instead of a raw interface pointer. For more information, see XRPtr<Interface>.

You can also define a combo box in Microsoft Silverlight 3 XAML. For information about the differences between XAML in XAML for Windows Embedded and Silverlight 3, see Differences Between Microsoft Silverlight 3 and XAML for Windows Embedded. For more information about how to define this element in the source XAML for your application, see the ComboBox Class on MSDN.

.NET Framework Equivalent

System.Windows.Controls.ComboBox

Requirements

Header

XamlRuntime.h

sysgen

SYSGEN_XAML_RUNTIME

See Also

Reference

Classes for UI Element Management