By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,855 Members | 1,996 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,855 IT Pros & Developers. It's quick & easy.

How can I execute a Sub with the value/text of every checked item inthe ListView?

P: n/a
Good day!

I was wondering if someone could show me the way with this little
problem I have.

I need to get the value/text of every checked SubItems in a listview
so I can execute a Sub.

The Sub I had created needs such value for inserting data in MySQL. My
Sub is called: InsertSelItem(ByVal SelItem As Integer)

I have a ListView (lvwItems) with Items that I get from a DB. In
lvwItems I have two columns. I get the value or text of a specific
item in a specific column using this:

Me.lvwItems.CheckedItems.Item(0).SubItems(1).Text

I also can get the number of checked items using this:

Me.lvwExpense.CheckedItems.Count.ToString

The question is: How can I execute a Sub with the value/text of every
checked item in the ListView?

Thanks in advance!

Regards,
iDesmet
Oct 31 '08 #1
Share this Question
Share on Google+
6 Replies


P: n/a
This is one possibility:

For Each lvi as ListViewItem In lvwItems.CheckedItems
Dim ItemX as ListViewItem.ListViewSubItemCollection=
lvi.SubItems
InsertSelItem(ctype(ItemX.Item(1).Text, Integer))
Next

"iDesmet" <id**********@gmail.comwrote in message
news:ef**********************************@i24g2000 prf.googlegroups.com...
Good day!

I was wondering if someone could show me the way with this little
problem I have.

I need to get the value/text of every checked SubItems in a listview
so I can execute a Sub.

The Sub I had created needs such value for inserting data in MySQL. My
Sub is called: InsertSelItem(ByVal SelItem As Integer)

I have a ListView (lvwItems) with Items that I get from a DB. In
lvwItems I have two columns. I get the value or text of a specific
item in a specific column using this:

Me.lvwItems.CheckedItems.Item(0).SubItems(1).Text

I also can get the number of checked items using this:

Me.lvwExpense.CheckedItems.Count.ToString

The question is: How can I execute a Sub with the value/text of every
checked item in the ListView?

Thanks in advance!

Regards,
iDesmet
Nov 1 '08 #2

P: n/a
This is one possibility:

For Each lvi as ListViewItem In lvwItems.CheckedItems
Dim ItemX as ListViewItem.ListViewSubItemCollection=
lvi.SubItems
InsertSelItem(ctype(ItemX.Item(1).Text, Integer))
Next

"iDesmet" <id**********@gmail.comwrote in message
news:ef**********************************@i24g2000 prf.googlegroups.com...
Good day!

I was wondering if someone could show me the way with this little
problem I have.

I need to get the value/text of every checked SubItems in a listview
so I can execute a Sub.

The Sub I had created needs such value for inserting data in MySQL. My
Sub is called: InsertSelItem(ByVal SelItem As Integer)

I have a ListView (lvwItems) with Items that I get from a DB. In
lvwItems I have two columns. I get the value or text of a specific
item in a specific column using this:

Me.lvwItems.CheckedItems.Item(0).SubItems(1).Text

I also can get the number of checked items using this:

Me.lvwExpense.CheckedItems.Count.ToString

The question is: How can I execute a Sub with the value/text of every
checked item in the ListView?

Thanks in advance!

Regards,
iDesmet
Nov 1 '08 #3

P: n/a
This is one possibility:

For Each lvi as ListViewItem In lvwItems.CheckedItems
Dim ItemX as ListViewItem.ListViewSubItemCollection=
lvi.SubItems
InsertSelItem(ctype(ItemX.Item(1).Text, Integer))
Next

"iDesmet" <id**********@gmail.comwrote in message
news:ef**********************************@i24g2000 prf.googlegroups.com...
Good day!

I was wondering if someone could show me the way with this little
problem I have.

I need to get the value/text of every checked SubItems in a listview
so I can execute a Sub.

The Sub I had created needs such value for inserting data in MySQL. My
Sub is called: InsertSelItem(ByVal SelItem As Integer)

I have a ListView (lvwItems) with Items that I get from a DB. In
lvwItems I have two columns. I get the value or text of a specific
item in a specific column using this:

Me.lvwItems.CheckedItems.Item(0).SubItems(1).Text

I also can get the number of checked items using this:

Me.lvwExpense.CheckedItems.Count.ToString

The question is: How can I execute a Sub with the value/text of every
checked item in the ListView?

Thanks in advance!

Regards,
iDesmet
Nov 1 '08 #4

P: n/a
This is one possibility:

For Each lvi as ListViewItem In lvwItems.CheckedItems
Dim ItemX as ListViewItem.ListViewSubItemCollection=
lvi.SubItems
InsertSelItem(ctype(ItemX.Item(1).Text, Integer))
Next

"iDesmet" <id**********@gmail.comwrote in message
news:ef**********************************@i24g2000 prf.googlegroups.com...
Good day!

I was wondering if someone could show me the way with this little
problem I have.

I need to get the value/text of every checked SubItems in a listview
so I can execute a Sub.

The Sub I had created needs such value for inserting data in MySQL. My
Sub is called: InsertSelItem(ByVal SelItem As Integer)

I have a ListView (lvwItems) with Items that I get from a DB. In
lvwItems I have two columns. I get the value or text of a specific
item in a specific column using this:

Me.lvwItems.CheckedItems.Item(0).SubItems(1).Text

I also can get the number of checked items using this:

Me.lvwExpense.CheckedItems.Count.ToString

The question is: How can I execute a Sub with the value/text of every
checked item in the ListView?

Thanks in advance!

Regards,
iDesmet
Nov 1 '08 #5

P: n/a
This is one possibility:

For Each lvi as ListViewItem In lvwItems.CheckedItems
Dim ItemX as ListViewItem.ListViewSubItemCollection=
lvi.SubItems
InsertSelItem(ctype(ItemX.Item(1).Text, Integer))
Next

"iDesmet" <id**********@gmail.comwrote in message
news:ef**********************************@i24g2000 prf.googlegroups.com...
Good day!

I was wondering if someone could show me the way with this little
problem I have.

I need to get the value/text of every checked SubItems in a listview
so I can execute a Sub.

The Sub I had created needs such value for inserting data in MySQL. My
Sub is called: InsertSelItem(ByVal SelItem As Integer)

I have a ListView (lvwItems) with Items that I get from a DB. In
lvwItems I have two columns. I get the value or text of a specific
item in a specific column using this:

Me.lvwItems.CheckedItems.Item(0).SubItems(1).Text

I also can get the number of checked items using this:

Me.lvwExpense.CheckedItems.Count.ToString

The question is: How can I execute a Sub with the value/text of every
checked item in the ListView?

Thanks in advance!

Regards,
iDesmet
Nov 1 '08 #6

P: n/a
On Nov 1, 3:29*am, "James Hahn" <jh...@yahoo.comwrote:
This is one possibility:

* * * * * * For Each lvi as ListViewItem In lvwItems.CheckedItems
* * * * * * * * Dim ItemX as ListViewItem.ListViewSubItemCollection=
lvi.SubItems
* * * * * * * * InsertSelItem(ctype(ItemX.Item(1).Text, Integer))
* * * * * * Next

"iDesmet" <idesmet.w...@gmail.comwrote in message

news:ef**********************************@i24g2000 prf.googlegroups.com...
Good day!
I was wondering if someone could show me the way with this little
problem I have.
I need to get the value/text of every checked SubItems in a listview
so I can execute a Sub.
The Sub I had created needs such value for inserting data in MySQL. My
Sub is called: InsertSelItem(ByVal SelItem As Integer)
I have a ListView (lvwItems) with Items that I get from a DB. In
lvwItems I have two columns. I get the value or text of a specific
item in a specific column using this:
Me.lvwItems.CheckedItems.Item(0).SubItems(1).Text
I also can get the number of checked items using this:
Me.lvwExpense.CheckedItems.Count.ToString
The question is: How can I execute a Sub with the value/text of every
checked item in the ListView?
Thanks in advance!
Regards,
iDesmet
Thanks a lot!

It worked like a charm!

Regards,
iDesmet
Nov 18 '08 #7

This discussion thread is closed

Replies have been disabled for this discussion.