Index | Collapse All Expand All

ListBox Class
Members Examples See Also

Beta Documentation - Subject to change.
A simple list box for laying out child controls in a list.

# Remarks

A list box is simply a container that performs automatic layout of its children. Additionally it monitors for when any of its list items are clicked and tracks which element is currently selected.

# Examples

This examples creates a listbox and populates it with randomly colored child controls.

Creating a Listbox | Copy Code
--- | ---
          window = Turbine.UI.Lotro.Window();
          window:SetPosition( 200, 200 );
          window:SetSize( 200, 200 );
          window:SetText( "Test" );
          window:SetVisible( true );

          listbox = Turbine.UI.ListBox();
          listbox:SetParent( window );
          listbox:SetBackColor( Turbine.UI.Color( 0.2, 0.2, 0.2 ) );
          listbox:SetPosition( 30, 50 );
          listbox:SetSize( 140, 120 );

          for i = 1, 20 do
            local listItem = Turbine.UI.Control();
            listItem:SetSize( 40, 20 );
            listItem:SetBackColor( Turbine.UI.Color( math.random(), math.random(), math.random() ) );
            listbox:AddItem( listItem );
          end

# Inheritance Hierarchy

Turbine.Object
Turbine.UI.Control
Turbine.UI.ScrollableControl
Turbine.UI.ListBox

# See Also

- Turbine.UI