I was trying to sum up all the items of a listbox in Visual Studio 2005. I tried to loop (from 0 to ListBox.Items.C ount - 1) as follows
For j as Integer = 0 to ListBox.Items.C ount - 1
sum = sum + val(ListBox.Ite ms.Item(j))
Next
My problem is: the sum variable keeps returning 0, and the
ListBox.Items.I tem(j) does not have a text property or value property. So, please how do I get hold on the text of an item of a listBox in VB.Net?
My OS is Vista Home Premium
For j as Integer = 0 to ListBox.Items.C ount - 1
sum = sum + val(ListBox.Ite ms.Item(j))
Next
My problem is: the sum variable keeps returning 0, and the
ListBox.Items.I tem(j) does not have a text property or value property. So, please how do I get hold on the text of an item of a listBox in VB.Net?
My OS is Vista Home Premium
Comment