I have a C# ListView
in mode "details", which makes the headers visible. I have 2 columns only, and still there's always a third junk empty one.
Anyone familiar with how to hide that ? I'm supposed to hand in a professional application and that's the kind of stuff that I'll get killed for GUI-wise..
Thanks ;)
That third one I believe is just the leftover space. You'll need to size the other columns to fit. See this posting: Adjust ListView columns to fit with WinForms
The key is the -2 on 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;
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With