|
-
March 14th, 2005, 07:58 PM
#1
Population a listBox
hello.
how do i populate a listbox with data?
thnx
-
March 14th, 2005, 08:58 PM
#2
Re: Population a listBox
listBox1.Items.Add("abc")
-
March 16th, 2005, 10:08 AM
#3
Re: Population a listBox
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)
-
March 16th, 2005, 10:34 AM
#4
Re: Population a listBox
Quell,
use ListView1.SelectedItems collection:
ListView1.SelectedItems.Count
ListView1.SelectedItems(i)
Hope it helps
Did it help? rate it.
The best conversation I had was over forty million years ago ... and that was with a coffee machine.
-
March 16th, 2005, 11:18 AM
#5
Re: Population a listBox
 Originally Posted by DeepButi
Quell,
use ListView1.SelectedItems collection:
...
Hope it helps
Did you realize what the OP is asking in the first place?
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!
Last edited by Ajay Vijay; March 16th, 2005 at 11:23 AM.
-
March 16th, 2005, 11:31 AM
#6
-
March 16th, 2005, 11:46 AM
#7
Re: Population a listBox
If u want do this i think the following code must be useful
Code:
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
Hope it is useful 4 u
Best of Luck
Regards
Gurmeet
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|