I am trying to make some note app for myself.
I can successfully get the course name, start date, end date and worked hours.
The problem is when I click the stop Button, I can't figure out how to add other data to same row but to the different columns.
private void button2_Click(object sender, EventArgs e) { ListViewItem item = new ListViewItem(); note.nameofcourse = textBox1.Text; item.Text = note.nameofcourse; listView1.Items.Add(item); DateTime date = DateTime.Now; note.dateofstart = date.ToString(); item.SubItems.Add(note.dateofstart); } private void button3_Click(object sender, EventArgs e) { DateTime time_2 = DateTime.Now; note.dateofend = time_2.ToString(); convertit(); } public void convertit() { DateTime dt = Convert.ToDateTime(note.dateofstart); DateTime d2 = Convert.ToDateTime(note.dateofend); TimeSpan totalsum = d2.Subtract(dt); note.totalsum = totalsum.ToString(); //item.SubItems.Add(note.totalsum); } Also this is my class.cs:
class noteInfos { public string nameofcourse; public string dateofstart; public string dateofend; public string totalsum; } 