List Box Events |
The AddString method adds a string item to the end of the list box list. If the Sort property is TRUE, string appears in the list in its sorted position. The DeleteString method deletes a string item from the list box list. The InsertString method inserts a string into the list box at a specified index.
longRet = ListBox.AddString(strItem as String)
longRet = ListBox.DeleteString(intItem as Long)
longRet = ListBox.InsertString(longIndex as Long, strItem
as String)
Element |
Description |
longRet |
Returns the index at which string was added. |
strItem |
A string to be added to the list box. |
intItem |
A integer indicating the index of the item to remove. |
The Error event is fired when an error occurs.
Private Sub ListBox_Error(short Number, BSTR* Description, SCODE Scode, BSTR Source, BSTR HelpFile, long HelpContext, boolean* CancelDisplay);
The SelChanged event is fired when the selection in the list box changes. Can be used to confirm user selection. Within the Mathcad framework, the Recalculate method can be called to update control and retrieve the current selection in the Exec event handler, using the CurSel property and the GetText method.
Private Sub ListBox_SelChanged()