How to sort List of Buttons
Hey beautiful people!
I'm working on a User Control, and I've created a List variable like this:
Then I search for all the buttons in the user control and add them:
I'd want to sort the list by the button names ('cause they're added in some unknown order)
Thanks!
Hey beautiful people!
I'm working on a User Control, and I've created a List variable like this:
Code:
Private vKey As New List(Of Button)
Then I search for all the buttons in the user control and add them:
Code:
Private Sub AddToList()
For Each Key As Control In Me.Controls
If TypeOf (Key) Is Button Then
vKey.Add(Key)
End If
Next
End Sub
I'd want to sort the list by the button names ('cause they're added in some unknown order)
Thanks!
Last edited: