none
How to get string value from the list of a Listbox? RRS feed

  • Question

  • Dear All,

    I'm a beginner in VB have a problem as I describe below.

    I have a Listbox named "Listbox1", the list consist of : "AAAA", "BBBB", "CCCC". I wanna display 3 times Message Box which is containing each value of the list.

    For d = 0 to 2

               msgbox listbox1............

    Next

    Thank you

    Thursday, December 24, 2015 4:44 AM

Answers

  • You could use

        For d = 0 To Me.ListBox1.ListCount - 1
            MsgBox Me.ListBox1.ItemData(d), vbInformation
        Next d


    Regards, Hans Vogelaar (http://www.eileenslounge.com)

    • Proposed as answer by André Santo Thursday, December 24, 2015 11:46 AM
    • Marked as answer by David_JunFeng Tuesday, January 5, 2016 1:39 AM
    Thursday, December 24, 2015 11:02 AM