|
-
Nov 26th, 2008, 03:52 PM
#1
Thread Starter
New Member
sorting control arrays
I have developed a scorecard program to keep the score in a game of dominos. I would like to add a function at the end of the game that will display who was in 1st place, 2nd place, 3rd place, etc. My program creates the labels that hold the player name and running score, and the text box that holds the score for the round on the fly as control arrays. I can use a bubble sort to sort the scores but how do I keep the name of the player with his or her score?
Thanks
-
Nov 26th, 2008, 04:55 PM
#2
Re: sorting control arrays
Welcome to the forum!
Have you used the controls Tag property?
It's a great place to store info
-
Nov 26th, 2008, 06:01 PM
#3
Thread Starter
New Member
Re: sorting control arrays
here is how I load the total score into the label control:
Code:
For I = 0 to intNumberofPlayers -1
intScore(I) = txtEnterScore(I).Text
intTotalScore(I) = intTotalScore(I) + intScore(I)
lblTotalScore(I).Caption = intTotalScore(I)
txtEnterScore(I)=""
Next
this adds each players score for the current round to their total score and displays the score in the label TotalScore. My player names are held in txtPlayerName(I). Can I make lblTotalScore(I).tag = txtPlayerName(I)? Will the tag property have the player number, the player name, or ?
thanks
-
Nov 26th, 2008, 07:06 PM
#4
Re: sorting control arrays
The tag property are string values. So you can pretty much make the tag represent anything. It would make sense to make it reference your txtPlayerName index.
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
|