Tuesday, 27 August 2013

creating an array of returned results to display in messagebox

creating an array of returned results to display in messagebox

I have this method that returns to the user a messagebox displaying the
results. But for multiple results there is message window that appears for
each result. How can i create it so that the results are put into an array
and then at the end display all the results to the user in one messagebox?
foreach (KeyValuePair<string, int> kvp in Comparer)
{
if (kvp.Value != 0)
{
mismatches++;
string InWhich = kvp.Value > 0 ? firstFile : secondFile;
MessageBox.Show("Extra value \n"+kvp.Key+" \nfound in
file " + InWhich);
if (Math.Abs(kvp.Value) != 1)
MessageBox.Show( Math.Abs(kvp.Value)+ "times");
}
}

No comments:

Post a Comment