Reputation: 329
been searching the internet for some time now and cant find a solution to my problem.
I'm trying to parse some lines into the richtextbox, but i only get one line instead of all of them. Heres a part of my code
foreach (var val in lineCountDict)
{
richTextBox2.Text = (val.Key + " - " + val.Value + " Drops -" +
((double)val.Value / (double)mobDeathCounter) * 100 + " % chance\n");
}
So when i run this i only get one line, any advice would be awesome
Thank you!
Upvotes: 1
Views: 430
Reputation: 4408
Of course you get one line since in each iteration you set richTextBox2.Text
to the new value which replaces the old value.
Use richTextBox2.Text+="..."
Upvotes: 1