I want to display the values in a dictionary in separate labels. I get the dictionary like this:
Dictionary<string, int> counts = new Dictionary<string, int>();
foreach (string code in myCodeList)
{
if (!counts.ContainsKey(code))
{
counts.Add(code, 1);
}
else
{
counts[code]++;
}
}
//now counts contains the expected values
I want to generate labels dynamically since elements in counts can only be determined at runtime.
This is the basic approach. All you have to do is adjust the variable
paccording to your design to locate the labels properly.