Hi There,
This may be a bit too advanced, but is there anyway to sort buttons by Alpheabtical order?
Thank You
J Mahone :)
Printable View
Hi There,
This may be a bit too advanced, but is there anyway to sort buttons by Alpheabtical order?
Thank You
J Mahone :)
What do you mean sort buttons? Do you mean there position on the form?
I don't really follow either, but I'll throw this out....
create a sortedlist(of String,Button) and put all of your buttons in it using the button name for the key, and the button proper for the value.
Attachment 109949HI There,
Sorry if I was being confusing, but I am trying to make a seating plan application, Attachment 109949
(See Image), and when I click on the 'Sort by Surname' tab, all of the buttons are sorted by alpheabetical order.
Do I use the same method that you have said?
Thank You
J Mahone :)
Don't even bother sorting the Buttons. Just sort the names. Sort the names and then loop through the Buttons and put the names on them in turn, e.g.Code:names.Sort()
For i = 0 to buttons.Count - 1
buttons(i).Text = names(i)
Next
Hi There,
Sorry, but I am a bit of a newbie at this, and I do not understand the code which you have provided.
Could you please explain what the coding means and how to type it up, that would be great.
Thank You
J Mahone :)
The code means that you have a list of names and a list of buttons, you sort the names and then you loop over both lists, displaying each name on the corresponding button. Think about it. If you had a room full of chairs and a name tag on each one, if you wanted to put the names on the tags in alphabetical order would you move the chairs or just the name tags? This is pretty much exactly the same thing.