What command should i use for me to compute the grade thaht was listed on the list box..that the user will input.. :confused: :confused: :confused:
Printable View
What command should i use for me to compute the grade thaht was listed on the list box..that the user will input.. :confused: :confused: :confused:
:ehh:
Welcome to the forums man.
You will have to explain some more for us, what do you mean by grade? And "how to compute the grade" is a very unclear question, by compute you can mean alot of things.
for example.. the user will input a number in the listbox example {78,90,89,....} the i will click the average button then it will compute the total average of the numbers that was input to the listbox
ah ok. Well you know how average values are calculated, correct?
Add all the values together and divide by the number of values.
So just do
VB Code:
dim dblTotal as Double = 0 For each str as string in ListBox1.Items dblTotal += Double.Parse(str) Next dblTotal = dblTotal / ListBox1.Items.Count
i see..thanks..
You're welcome. If your problems are solved than resolve your thread using the thread tool menu at the top of the thread. Or do you want more explanation to the code?
oh.pls explain how this code works...thanks
what about for example i will clear the listbox but there is no list at all, when i click the clear button it should show a message box that "no list to be cleared"..