Table of Contents

Class ListBox

Namespace
nanoFramework.Presentation.Controls
Assembly
nanoFramework.Graphics.dll

Represents a control that displays a list of items, where an item in the list can be selected.

public class ListBox : ContentControl
Inheritance
ListBox
Inherited Members
Extension Methods

Constructors

ListBox()

Initializes a new instance of the ListBox class.

public ListBox()

Properties

ExtentHeight

Gets the extent height of the scrollable content.

public int ExtentHeight { get; }

Property Value

int

ExtentWidth

Gets the extent width of the scrollable content.

public int ExtentWidth { get; }

Property Value

int

HorizontalOffset

Gets or sets the horizontal scroll offset.

public int HorizontalOffset { get; set; }

Property Value

int

Items

Gets the collection of items in the ListBox.

public ListBoxItemCollection Items { get; }

Property Value

ListBoxItemCollection

ScrollingStyle

Gets or sets the scrolling behavior.

public ScrollingStyle ScrollingStyle { get; set; }

Property Value

ScrollingStyle

SelectedIndex

Gets or sets the index of the currently selected item in a ListBox.

public int SelectedIndex { get; set; }

Property Value

int

SelectedItem

Gets or sets the currently selected item in a ListBox.

public ListBoxItem SelectedItem { get; set; }

Property Value

ListBoxItem

VerticalOffset

Gets or sets the vertical scroll offset.

public int VerticalOffset { get; set; }

Property Value

int

Methods

OnButtonDown(ButtonEventArgs)

Called when a button is pressed down. If the button is VK_DOWN and the currently selected item is not the last item, the selection is moved down to the next selectable item. If the button is VK_UP and the currently selected item is not the first item, the selection is moved up to the previous selectable item.

protected override void OnButtonDown(ButtonEventArgs e)

Parameters

e ButtonEventArgs

The ButtonEventArgs containing information about the button press.

ScrollIntoView(ListBoxItem)

Scrolls the ListBox to bring the specified ListBoxItem into view.

public void ScrollIntoView(ListBoxItem item)

Parameters

item ListBoxItem

The ListBoxItem to bring into view.

Events

ScrollChanged

Occurs when the scroll position changes.

public event ScrollChangedEventHandler ScrollChanged

Event Type

ScrollChangedEventHandler

SelectionChanged

Occurs when the selection of a ListBox item changes.

public event SelectionChangedEventHandler SelectionChanged

Event Type

SelectionChangedEventHandler