Actually in C # WinForms, you need to add to the var. tasks, these tabs and process sorting - by alpha, memory sorting - descending and state. What are these tabs anyway? How to add them?

Tabs highlighted

  • these are the headings of the GridView columns, you do not need to add anything, they are there, you only need to add and configure columns correctly. There are examples in MSDN. Try to do it yourself and add to the question what did not work out. - rdorn

1 answer 1

All figured out. That's what did

ListViewItem row; proces = Process.GetProcesses(); if (Convert.ToInt32(label2.Text) != proces.Length) { LstProc.Items.Clear(); for (int i = 0; i < proces.Length; i++) { row = new ListViewItem(proces[i].ProcessName); // Создаем переменную row для обращения к ней, при добавлении суб айтемов. row.SubItems.Add((proces[i].VirtualMemorySize64 / 2048).ToString() + " КБ"); row.SubItems.Add("Работает"); row.SubItems.Add(proces[i].SessionId.ToString()); LstProc.Items.Add(row); List<ListViewItem> arrayToDelete = new List<ListViewItem>(); for (int j = 0; j < LstProc.Items.Count; j++) if (LstProc.Items[j].SubItems[2].Text == "*") arrayToDelete.Add(LstProc.Items[j]); foreach (ListViewItem delete in arrayToDelete) LstProc.Items.Remove(delete); } label2.Text = proces.Length.ToString(); } }'