On the application I’m building for a cyclist race, where as cyclists go over the finish line, I have to enter the time (hours, mins, secs) and click the finish button. Once I click the finish button, I want this information to be displayed in lblScoreboard as:
Competitive cyclist No. 1 has completed in 1:23:49
Then as another cyclists time has been entered, the lblScoreboard should look like:
Competitive cyclist No. 1 has completed in 1:23:49
Competitive cyclist No. 9 has completed in 1:20:30
The code I’ve used in my ‘Finished’ button is:
lblCyclistsFinished.Text = finishLine.Scoreboard(currentCyc);
and the code behind the FinishLine class is:
class FinishLine
{
public string Scoreboard(Cyclists cyc)
{
String msg;
msg = cyc.ToString();
return msg;
}
}
However, with the code in FinishLine, it will display one result, but as soon as I enter a new result; it replaces the first one so there’s only ever 1 result displayed.
The information I want passed is: Type + “No. ” + Number + ” has completed in ” + Hours + “:” + Mins + “:” + Secs;
the
"\n"is the newline character. for reference.