Search code examples
c#winformslistviewscrollable

Making ListView scrollable in vertical direction


I am using a System.Windows.Forms.ListView with checkboxes = true. I can see that when the list items are more than what can fit, I get a horizontal scroll bar. I tried to find any properties to change scroll bar orientation. Is there any way to make it scrollable in vertical direction?


Solution

  • You need to Set

    Listview1.Scrollable = true;
    Listview1.View = View.Details
    

    This will only work correctly if you have added some columns in your Listview1, So add a dummy column. like,

    ColumnHeader header = new ColumnHeader();
    header.Text = "";
    header.Name = "col1";
    listView1.Columns.Add(header);