I have a code that takes the data from the dictionary and writes it into a label, but in which they are. And I need to do so that it is recorded in the format of minutes, that is:
minutes: seconds
mm: ss
Here is the code that performs the mapping to the label:
private void updateRatingLabels2()
{
var tops = AllNames2()
.OrderBy(pair => pair.Value)
.ThenBy(pair => pair.Key, StringComparer.Ordinal)
.Take(5)
.ToArray();
for (int i = 23; i <= 27; ++i)
Controls.Find($"label{i}", true).First().Text = "";
for (int i = 33; i <= 37; ++i)
Controls.Find($"label{i}", true).First().Text = "";
for (int i = 0; i < tops.Length; ++i)
{
Controls.Find($"label{i + 23}", true).First().Text = tops[i].Key;
Controls.Find($"label{i + 33}", true).First().Text = tops[i].Value.ToString();
}
}
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…