Text

Syntax for ListBox, DropDownListBox, PictureListBox, and DropDownPictureListBox controls

Description

Obtains the text of an item in a ListBox control.

Applies to

ListBox, DropDownListBox, PictureListBox, and DropDownPictureListBox controls

Syntax

listboxname.Text ( index )

Argument

Description

listboxname

The name of the ListBox control in which you want the text of an item

index

The number of the item for which you want the text


Return value

String.

Returns the text of the item in listboxname identified by index. If the index does not point to a valid item number, Text returns the empty string (""). If any argument's value is null, Text returns null.

Examples

Assume the ListBox lb_Cities contains:

Atlanta

Boston

Chicago

Then these statements store the text of item 3, which is Chicago, in current_city:

string current_city
current_city = lb_Cities.Text(3)

See also

FindItem

SelectedItem

SelectedText

Syntax for RibbonComboBoxItem controls

Description

Obtains the text of an item from a ribbon combo box.

Applies to

RibbonComboBoxItem controls

Syntax

controlname.Text (Integer Index)

Argument

Description

controlname

The name of the RibbonComboBoxItem control for which you want to get the text

Index

The index of the item for which you want the text


Return value

String.

Returns the text of the item in the box portion of the combo box. If any argument's value is null, returns null.

Examples

This example gets the text of the item whose index number is 2. It returns "Item2".

Integer li_Return
String ls_Text
RibbonComboBoxItem lr_ComboBox

li_Return = lr_ComboBox.AddItem("Item1")
li_Return = lr_ComboBox.AddItem("Item2")
ls_Text = lr_ComboBox.Text(2)