Forum Discussion

mfoster711's avatar
mfoster711
Regular Contributor
12 years ago

User Form text of selected item

How do you get the text of the currently selected item in a tcxListBox control of a User Form? I seem to be spinning my wheels and not finding the solution.
  • paul_scroce's avatar
    12 years ago


    Hi Mark



    According to this article http://support.smartbear.com/viewarticle/28763/



    The ItemIndex property specifies the index of the currently selected list box item.

    The Items property returns the TStrings which contains the list of strings displayed by the component.



    So this would get the text of the currently selected item

    Set TStringsObj = TcxListBoxObj.Items

    String = TStringsObj.Items(TcxListBoxObj.ItemIndex)