If you are using a standard ListBox (on the ‘Standard’ tab on the component palette), you need to use the ItemIndex property to obtain the index of the selected item. This is an integer value that returns -1 if no item is selected, or the index value of the selected item in the list.
Given a ListBox control call ‘testListBox1’ on a form called ‘test’, you could display the selected selected item like this:
if test.testListBox1.ItemIndex <> -1 then MsgBox test.testListBox1.Items(test.testListBox1.ItemIndex) end if
You may also want to take a look at the updated Examples Pack, which contains three V2 solutions that use forms. The pack contains full source code, which may be helpful. Download it from: http://www.advansyscorp.com/download/examples_pack.exe.
I hope this helps.