hello.
how do i populate a listbox with data?
thnx
Printable View
hello.
how do i populate a listbox with data?
thnx
listBox1.Items.Add("abc")
hey, how do i also check what item is selected. I got a function that handles the double click, how do i get whihc item in the lsit box is selected?(number of it...index of it if u may)
Quell,
use ListView1.SelectedItems collection:
ListView1.SelectedItems.Count
ListView1.SelectedItems(i)
Hope it helps
Did you realize what the OP is asking in the first place?Quote:
Originally Posted by DeepButi
He is asking about ListBox and not ListView. List box holds (commonly) only one column, and list view (generally) holds more than 1 columns. List view is like Detailed view in Windows explorer, whereas list-box is like fonts list in Font dialogs (which are actually Combo-boxes).
If you actually meant ListBox, instead of ListView, your code is perfect! :thumb:
Oooops! true ... :blush: :blush: one hundred milion times sorry. I meant ListBox1 :blush: :blush: .
(Although nothing prevents you from using ListView1 as the ListBox name :p :p :p )
If u want do this i think the following code must be useful
Hope it is useful 4 uCode:Dim i, a As Integer
For i = 0 To ListBox1.SelectedItems.Count() - 1
'Do Ur processing here what do you want
a=ListBox1.SelectedItems(i)
'a hold the current i element's index in main listbox1 Array
Next
Best of Luck :thumb:
Regards
Gurmeet :D