C # Listview, remove junk email column

I have a C # ListView in "detail" mode, which makes the headers visible. I have only 2 columns and I always have the third empty trash.

Is anyone familiar with how to hide this? I have to pass a professional application and what I'm going to kill for GUI-wise.

Thanks;)

+6
source share
1 answer

The third one that I think is just the remaining space. You will need to sort the remaining columns. See This Post: Adjust ListView Columns According to WinForms

Key-2 in the last column:

 [c#] private void Form1_Load(object sender, System.EventArgs e) { SizeLastColumn(lvSample); } private void listView1_Resize(object sender, System.EventArgs e) { SizeLastColumn((ListView) sender); } private void SizeLastColumn(ListView lv) { lv.Columns[lv.Columns.Count - 1].Width = -2; }
[c#] private void Form1_Load(object sender, System.EventArgs e) { SizeLastColumn(lvSample); } private void listView1_Resize(object sender, System.EventArgs e) { SizeLastColumn((ListView) sender); } private void SizeLastColumn(ListView lv) { lv.Columns[lv.Columns.Count - 1].Width = -2; } 
+6
source

Source: https://habr.com/ru/post/901824/