|
-
Jan 25th, 2014, 01:05 PM
#1
Thread Starter
New Member
Sorting Buttons
Hi There,
This may be a bit too advanced, but is there anyway to sort buttons by Alpheabtical order?
Thank You
J Mahone
-
Jan 25th, 2014, 01:28 PM
#2
Re: Sorting Buttons
What do you mean sort buttons? Do you mean there position on the form?
-
Jan 25th, 2014, 01:34 PM
#3
Re: Sorting Buttons
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.
Last edited by kebo; Jan 25th, 2014 at 01:40 PM.
Process control doesn't give you good quality, it gives you consistent quality.
Good quality comes from consistently doing the right things.
Vague general questions have vague general answers. A $100 donation is required for me to help you if you PM me asking for help. Instructions for donating to one of our local charities will be provided.
______________________________ Last edited by kebo : Now. Reason: superfluous typo's
-
Jan 26th, 2014, 05:15 AM
#4
Thread Starter
New Member
-
Jan 26th, 2014, 05:26 AM
#5
Re: Sorting Buttons
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
-
Jan 26th, 2014, 06:53 AM
#6
Thread Starter
New Member
Re: Sorting Buttons
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
-
Jan 26th, 2014, 08:11 AM
#7
Re: Sorting Buttons
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.
Tags for this Thread
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|