Shiny Language Reference

Language Reference > User Interface > List Boxes


getlistboxitemtext

string setlistboxitemtext(int ID, int Index);

 

Synonyms:

string getlistitemtext(int ID, int Index);

string getlbitemtext(int ID, int Index);

 

Retrieves the text of the specified item

The GETLISTBOXITEMTEXT statement retrieves the item text at the specified index in the list box. Indexes are unique, therefore this statement will only alter one item. An item's index is returned by the addlistboxitem statement, or the getlistboxcursel statement.

 

Parameters

ID

The control ID of the control you wish to retrieve the item text in

Index

The index of the item to retrieve the text of

 

Return Value

The text of the specified item, or an empty string if the operation failed (due to invalid item etc).

 

Example Code

// Create the edit box X: 10, Y:10 and sized 200*120
int iListBoxID = createlistbox(1, 10, 10, 200, 120);

// Add "Test item" to the listbox
int Index = addlistboxitem(iListBoxID, "Test item");


// Retrieves the "Test item" string using the index
string Text = getlistboxitemtext(iListBoxID, Index);