|
-
Mar 30th, 2006, 03:37 AM
#1
Thread Starter
Lively Member
[RESOLVED] listBox how to get specific items
well anybody know how can i get for example the second item from a listbox????????????
Last edited by Hack; Mar 30th, 2006 at 10:48 AM.
Reason: Added [RESOLVED] to thread title and green "resolved" checkmark
-
Mar 30th, 2006, 03:48 AM
#2
Re: listBox how to get specific items
If an answer to your question has been helpful, then please, Rate it!
Have done Projects in Access and Member management systems using BioMetric devices, Smart cards and BarCodes.
-
Mar 30th, 2006, 03:49 AM
#3
Re: listBox how to get specific items
syntax is
control.List(position)
position starts from 0 so, 2nd item means 1
If an answer to your question has been helpful, then please, Rate it!
Have done Projects in Access and Member management systems using BioMetric devices, Smart cards and BarCodes.
-
Mar 30th, 2006, 03:49 AM
#4
Member
Re: listBox how to get specific items
If you wanted to msgbox out the third item:
msgbox Me.List1.List(2)
Obviously this is assuming your list is called List1.
-
Mar 30th, 2006, 03:49 AM
#5
Frenzied Member
Re: listBox how to get specific items
to get the second item from the listbox, do it like this
VB Code:
dim SecondVal As String
SecondVal = list1.list(1)
to get specific values in a listbox, use the list property and supply the index number of the data you want to retrieve
the index starts with 0 so if the listbox has 5 items, the index would range from 0 to 4
or 0 to list1.ListCount - 1
ListCount returns the total number of items in your listbox
On error goto Trap
Trap:
in case of emergency, drop the case...
****************************************
If this post has been resolved. Please mark it as "Resolved" by going through the "Thread Tools" above and clicking on the "Mark Thread Resolved " option. if a post is helpful to you, Please Rate it by clicking on the Rate link right below the avatar
-
Mar 30th, 2006, 03:50 AM
#6
Re: listBox how to get specific items
Do you mean
(The index starts at 0, so item 2 has index 1)
I code C#....

-
Mar 30th, 2006, 03:51 AM
#7
Re: listBox how to get specific items
Whoh, 5 similar posts in less than a minute
I code C#....

-
Mar 30th, 2006, 03:58 AM
#8
Thread Starter
Lively Member
Re: listBox how to get specific items
thanks...................
-
Mar 30th, 2006, 04:01 AM
#9
Frenzied Member
Re: listBox how to get specific items
then can you mark this thread as resolved. just see my signature <below the line after this message> for instructions on how to do it ok.
On error goto Trap
Trap:
in case of emergency, drop the case...
****************************************
If this post has been resolved. Please mark it as "Resolved" by going through the "Thread Tools" above and clicking on the "Mark Thread Resolved " option. if a post is helpful to you, Please Rate it by clicking on the Rate link right below the avatar
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
|