I have made a dictionary which contains two values: a DateTime
and a string
.
Now I want to print everything from the dictionary to a Textbox. Does anybody know how to do this?
I have used this code to print the dictionary to the console:
private void button1_Click(object sender, EventArgs e)
{
Dictionary<DateTime, string> dictionary = new Dictionary<DateTime, string>();
dictionary.Add(monthCalendar1.SelectionStart, textBox1.Text);
foreach (KeyValuePair<DateTime, string> kvp in dictionary)
{
//textBox3.Text += ("Key = {0}, Value = {1}", kvp.Key, kvp.Value);
Console.WriteLine("Key = {0}, Value = {1}", kvp.Key, kvp.Value);
}
}
string.Format
in the commented out line.