I'm working on a Windows CE form with inside a listview this listview is composed of two text columns which represent, respectively, a numerical code and the corresponding description, for example:
Code Code Description
01 | Red lamp off
89 | stackoverflow is a cool community
03 | pump 01 on
00 | Red lamp flashing
and so on
I inserted within the form a combobox populated with numeric values in text format from "00" to "99" and a Textbox where you can write freely.
by means of two command buttons I can insert inside the listview a new combination of code/description element, modify the text of a code already inserted, or delete the entire line composed by the code and the text associated to it. listview.
'--- Functions Used by me ---
'creating a new element inside the listview
Dim ListCode As New ListViewItem("00")
ListCode.SubItems.Add("Red lamp flashing")
myListView.Items.Add(ListCode)
'deleting an element inside the listview
myListView.Items(lvPosition).Remove()
'--- 000 ---
So far so good (Bryan Adams)
The problems start now Not working on a windows form but with a Windows CE form (.net compact framework), I do not have the selectable sort property available in the visual studio properties window I need to apply a selection sorting algorithm so as to obtain the elements in ascending order:
00 | Red lamp flashing
01 | Red lamp off
03 | pump 01 on
89 | stackoverflow is a cool community
programming in visual basic .NET and not in old VB "I think" to be handling the arrays of objects and not simple strings, am I wrong?
this is the simplest algorithm for sorting elements in a Long Array[0..n]:
adapt