Windows Forms ListView missing horizontal scrollba

2019-07-11 21:32发布

I have a Windows Forms ListView in a form (C#, VS 2005) and have it anchored to all the edges of the form so that it entirely fills the form excluding the status bar. The ListView is in detail mode and the columns are very wide - definitely wider than the display area. I have a vertical scrollbar but no horizontal scrollbar.

I can scroll to the left and right with the keyboard when the control has the focus, but I cannot get the scrollbar to display.

Scrollable is set to true.

What am I missing?

4条回答
混吃等死
2楼-- · 2019-07-11 21:38

If Scrollable was set to false, you wouldn't be able to scroll with the keyboard, so the status bar must be hiding the scrollbar from you.

What you can do it set the listview's dock to Fill or shrink the listview a little to not go under the status bar.

查看更多
看我几分像从前
3楼-- · 2019-07-11 21:41

It looks like the status bar is hiding the horizontal scroll bar, besides than changing the Dock property to Fill, you can check whether:

  • Add a SplitContainer and arrange the Controls inside of them
  • Modify your Status Bar's Dock to bottom
  • Add a FlowLayoutPanel and put your Controls inside of it.

Hope these tips be useful

查看更多
看我几分像从前
4楼-- · 2019-07-11 21:55

Rather than anchoring it to all four sides to fill the area, try setting the Dock property to Fill.

查看更多
We Are One
5楼-- · 2019-07-11 22:03

Had the same problem with the status bar hiding the horizontal scroll bar of an ImageBox (emgu) seem that the order of placing the GUI elements is important here. place the ListView / ImageBox after you place the status bar and it will work like a charm.

查看更多
登录 后发表回答