Shiny Language Reference

Language Reference > User Interface > List Boxes


setlistboxitemtext

bool setlistboxitemtext(int ID, int Index, string Text);

 

Synonyms:

bool setlistitemtext(int ID, int Index, string Text);

bool setlbitemtext(int ID, int Index, string Text);

 

Changes the text of the specified item

The SETLISTBOXITEMTEXT statement changes 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.

 

Parameters

ID

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

Index

The index of the item to change

Text

The new item text

 

Return Value

TRUE if an item was changed, otherwise FALSE if the change failed (due to an invalid index, invalid control ID or other similar causes).

 

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");


// Change the "Test item" string
setlistboxitemtext(iListBoxID, Index, "Different text");