santBart santBart -4 years ago 200
C# Question

c# listview class - lock possibility to resize columns

I'm using windows forms and listviewclass. I wish to lock possibility to resize columns width by user. Can anyone help me?

Answer Source

You can use this little hack:

    private void listviewname_ColumnWidthChanging(object sender, ColumnWidthChangingEventArgs e)
    {
        e.Cancel = true;
        e.NewWidth = listviewname.Columns[e.ColumnIndex].Width;
    }

But this doesnt handles the cursor

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download