It's pretty straight forward.
This should be code for using the "top" two elements.
-
Dim mystr1 as String("")
-
Dim mystr2 as String("")
-
-
'I think Array indexes in VB start with 1, if they start with 0 like they should
-
'Then just change the 1 and 2 to 0 and 1
-
mystr1=listBox1.Items(1).ToString()
-
mystr1=listBox1.Items(2).ToString()
-
i have retrieved 3 marks of a student and i have to select best two
out of them.i used the sort property of listbox so that marks comes
in sorted order and i can take the best two marks but its not working.
how can i take best two marks from the listbox.another way which i thought
was to transfer the contents of listbox to array sort it and take the values
at indices 1 and 2 which will be highest and second highest
but i was not able to write the code for that.how can i
do this or can u tell me any other method to do this....