Good day to all,
apart from it being my birthday, found some quick time to post this question on here.
I have a flowlayoutpanel, and a bunch of controls inside it.
I would like to actually SORT the controls, depending on some values.
The FlowLayoutPanel has 4 Controls:
Each control has: Name (string), Maker (string) and Rated (integer) values.
So what I thought of was:
That would arrange the controls depending on the title.text each one has. Now this works but its not very optimal and it will dont work for DESCENDING or work properly with the Rated integer.
Now I had a search around forums and came across Icomparable, and decided to have a go at it but I can't really get it to work:
m_title = thetitle
m_maker = themaker
m_rated = therated
(AnEmployee, Employee).Rated < Me
(AnEmployee, Employee).Rated = Me
(AnEmployee, Employee).Rated > Me
' AND TO CALL IT is where I came across where I can't go on...:
Employee(c.title.Text, c.maker.Text, c.rating.text)
'didnt know how to add A to theEmployees (most of the code was grabbed from Microsoft's forums, and didn't fully understand it.
Array.Sort(theEmployees) 'call the CompareTo
So as you can see I basiclly messed everything up..
All I wanted was a A..Z (Ascending) sorting option for either the Title, Maker or Rated, and a Z...A (Descending) sorting for the same.
If anyone can put me on the right track it would be great :) Thanks!