473,395 Members | 1,556 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

Mulitselect listbox

How can i get the itemdata form each item in a mulitselect list.

I made a loop but keep getting only the first value.

Dim i

Dim array1(100)

For i = 1 To aantalrecords

If ListBox1.GetSelected(i - 1).ToString = True Then

ListBox1.SelectedIndex = i - 1

mylist = ListBox1.SelectedItem

array1(i) = mylist.ItemData

End If

Next

can someone please help me out?

Eric
Nov 20 '05 #1
13 1140
* "Eric Schreiber" <es**@cistron.nl> scripsit:
How can i get the itemdata form each item in a mulitselect list.


There is no 'ItemData' property in VB.NET.

--
Herfried K. Wagner [MVP]
<http://www.mvps.org/dotnet>
Nov 20 '05 #2
Cor
Hi Eric,

You think you made a loop but you did not,
You have to loop through the items from your listbox

Beneath some examples, roughly written so watch errors

I hope this helps?

Cor

something as for a winform
\\\
dim myarray(listbox1.selecteditems) as string
dim i as integer
for i = 0 to listbox1.selecteditems.count - 1
myarray(i) = listbox1.selecteditems(i).text
next
///
and for a webform
dim myarray(listbox1.items) as string
dim i as integer
for i = 0 to listbox1.items.count - 1
if listbox1.Items(i).selected then
myarray(i) = listbox1.selecteditems(i).text
end if
next
///
I hope this helps?

Cor

How can i get the itemdata form each item in a mulitselect list.

I made a loop but keep getting only the first value.

Dim i

Dim array1(100)

For i = 1 To aantalrecords

If ListBox1.GetSelected(i - 1).ToString = True Then

ListBox1.SelectedIndex = i - 1

mylist = ListBox1.SelectedItem

array1(i) = mylist.ItemData

End If

Next

can someone please help me out?

Eric

Nov 20 '05 #3
Cor
Hi Herfried,
* "Eric Schreiber" <es**@cistron.nl> scripsit:
How can i get the itemdata form each item in a mulitselect list.


There is no 'ItemData' property in VB.NET.


Have a look at this links

http://www.plig.net/nnq/nquote.html
http://www.netmeister.org/news/learn2quote.html

This is the worst quoting what you do here, using words from a message

I have seen this more from you quoting and deleting the essential things
from a message.

Cor
Nov 20 '05 #4
Cor
Hi Herfried,

I forgot to write, not angry only to help of course

:-)

Cor
Nov 20 '05 #5
"Cor" <no*@non.com> schrieb
This is the worst quoting what you do here, using words from a
message

I have seen this more from you quoting and deleting the essential
things from a message.

He doesn't have to quote everything. The question is sufficient. Apart from
this, you should better complain about those 500:1 lines quotes and sending
the quote again and again and again and again and again....must I continue?

:-(
--
Armin

http://www.plig.net/nnq/nquote.html
http://www.netmeister.org/news/learn2quote.html

Nov 20 '05 #6
Cor
Hi Armin,

He doesn't have to quote everything. Text from one of the first rows from one by you always needless sended extra
rows

On the other hand, the quotation should not be so short that it is unclear
to what the author is referring to, or so that it may even appear in a
totally different light.
The question is sufficient.
Who are you that you can say that, I think it is not. (you see think)
Apart from this, you should better complain about those 500:1 lines quotes and sending the quote again and again and again and again and again....must I

continue?

I am me not aware that I do that, but when I do please point me on that.

Cor

Nov 20 '05 #7
"Cor" <no*@non.com> schrieb

He doesn't have to quote everything.

Text from one of the first rows from one by you always needless
sended extra rows

On the other hand, the quotation should not be so short that it is
unclear to what the author is referring to, or so that it may even
appear in a totally different light.


Herfried's answer referred to the question. Why should he quote the code
also?
The question is sufficient.


Who are you that you can say that, I think it is not. (you see
think)


The question is not "who" I am. The question is if it's right or not. He
didn't refer to the code, so it's not necessary to quote it. Consequently it
is sufficient to quote the question. That's what remains and that's the
logical explanation, independent from "who" writes it.

Apart from this, you should better complain about those 500:1 lines
quotes

and
sending the quote again and again and again and again and
again....must I

continue?

I am me not aware that I do that, but when I do please point me on
that.


I think you misunderstood. I did not say you *do* complain, I said you do
*not* complain.
--
Armin

Nov 20 '05 #8
Cor
Armin,
Herfried's answer referred to the question. Why should he quote the code
also?
There is not spoken about an itemdata property in the question.

If Herfried had quoted right than his answer was maybe right but still not
correct.
including the quoting it had minimal to be.

------------------How can i get the itemdata form each item in a mulitselect list. ...................array1(i) = mylist.ItemData


There is no 'ItemData' property in VB.NET.
-------------------

Cor
Nov 20 '05 #9
"Cor" <no*@non.com> schrieb
Herfried's answer referred to the question. Why should he quote the
code also?


There is not spoken about an itemdata property in the question.

If Herfried had quoted right than his answer was maybe right but
still not correct.
including the quoting it had minimal to be.


If you want the full text, read the initial message.

EOT for me. :-)
--
Armin

http://www.plig.net/nnq/nquote.html
http://www.netmeister.org/news/learn2quote.html

Nov 20 '05 #10
* "Armin Zingler" <az*******@freenet.de> scripsit:
I have seen this more from you quoting and deleting the essential
things from a message.


He doesn't have to quote everything. The question is sufficient. Apart from
this, you should better complain about those 500:1 lines quotes and sending
the quote again and again and again and again and again....must I continue?


Yes, please... Make a 100,000 line quote...

;-)

--
Herfried K. Wagner [MVP]
<http://www.mvps.org/dotnet>
Nov 20 '05 #11
* "Cor" <no*@non.com> scripsit:
Herfried's answer referred to the question. Why should he quote the code
also?


There is not spoken about an itemdata property in the question.


Are /you/ sure, you read the question?!

--
Herfried K. Wagner [MVP]
<http://www.mvps.org/dotnet>
Nov 20 '05 #12
* "Cor" <no*@non.com> scripsit:
How can i get the itemdata form each item in a mulitselect list.


There is no 'ItemData' property in VB.NET.


Have a look at this links

http://www.plig.net/nnq/nquote.html
http://www.netmeister.org/news/learn2quote.html

This is the worst quoting what you do here, using words from a message


What's the problem? I only quoted things I referred to in the reply.

--
Herfried K. Wagner [MVP]
<http://www.mvps.org/dotnet>
Nov 20 '05 #13
Responding to message:
news:bu************@ID-208219.news.uni-berlin.de

We're not going to start this argument up again are we?
Nov 20 '05 #14

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

17
by: amber | last post by:
Hello. Can someone tell me what I may be doing wrong here? I'm using the code (lboxRP is a listbox): Dim newRPindex As Integer newRPindex = Me.lboxRP.FindString(RP)...
1
by: Jake Jessup | last post by:
I have a multiselect list box but I am not sure how to insert those values in to my SQL back end. With the code I've written it will insert the same one twice which obviously isn't right. I...
3
by: Paul T. Rong | last post by:
I have a listbox (of product names) control on my form. I want to pass the selected item (a product name) to a subform, and the product unitprice should apear automatically next to the product name...
8
by: Oddball | last post by:
Ok - I have a ListBox control and I'm ready to write my own DrawItem event handler. What I want to draw as the item is another control. I have created a user control that I would like to list in...
6
by: Chris Leuty | last post by:
I am populating a multiselect Listbox from a dataset, with the content of the listbox filled by one table, and the selections determined from another table. So far, I have been keeping the dataset...
7
by: Dave | last post by:
Hi all, After unsuccessfully trying to make my own dual listbox control out of arraylists, I decided to look for a 3rd party control. I've looked for over a week now and can't find anything but...
3
by: Ali Chambers | last post by:
Hi, I have created a listbox called "dtlist1" on my VB.NET form. I call a procedure as follows: Private Sub openfile(flname As String) dtlist1.Items.Clear() etc..
1
by: Sunray | last post by:
I have a form called the sales form and i have 2 sets of listboxes So what happens is. i add items form the bottom set of list boxes which are bound to a data base to the top set of list boxes which...
5
by: Academia | last post by:
(If you've seen this in the drawing NG, sorry. I inadvertently sent it there.) I have a listbox populated with Objects. The Class has a String field that ToString returns. I assume that...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.