Addition
-
How can I the sum of say(Items in a listbox): 6.78 9.05 5.56 4.45 displayed in a textbox with the answer given with 2 decimal places.
-
How can I the sum of say(Items in a listbox): 6.78 9.05 5.56 4.45 displayed in a textbox with the answer given with 2 decimal places.
Iterate through the items in a Listbox by using its Items property and use a variable who receives the values and add them then display that variable in the Textbox you can iterate by using For Each loop. You can use FormatNumber function to display values up to two decimal places. Hope it helps !
AliAmjad(MCP)
-
Iterate through the items in a Listbox by using its Items property and use a variable who receives the values and add them then display that variable in the Textbox you can iterate by using For Each loop. You can use FormatNumber function to display values up to two decimal places. Hope it helps !
AliAmjad(MCP)
Can you give an example please
-
Can you give an example please
AliAmjad pretty much spelled it out for you.
"Real programmers just throw a bunch of 1s and 0s at the computer to see what sticks" - Pete O'Hanlon
-
Can you give an example please
Dim sum as decimal for i as integer = 0 to me.listbox1.count - 1 sum += me.listbox1.items.item(i) next i
Please check out my articles: The ANZAC's articles
-
How can I the sum of say(Items in a listbox): 6.78 9.05 5.56 4.45 displayed in a textbox with the answer given with 2 decimal places.
Use Decimal for a variable then, as was said, Iterate through.
Regards Zeldacat