开发者

Force Vertical Scrollbar to be Visible in Panel

I have a Windows Forms VB.NET application, with a panel that contains a few other controls.

I set the panel's AutoScroll property to True, and that seems to appropriately apply the scroll bars when they are needed. The issue is that a user must scroll all the way to the right to access the vertical scroll bar. Is there a way to always show the vertical scrollbar no matter where the user is scrolled horizontally?

EDIT I guess the开发者_运维技巧 main problem I have here is that I have a DataGridView inside of a panel. I want the panel to do the vertical scrolling, and not the DataGridView. Why is it when I turn off vertical scrollbars on the datagridview and have autoscroll on the panel, a vertical scroll bar is never shown?


You could add a VScrollBar on the right side of the panel and set code behind to move the panel scroll up and down.

or

A better option may be to switch your panel to a FlowLayoutPanel which provides quite a bit of control over the scroll handles both vertical and horizontal.

Check out MSDN and see how to use all of the properties of the FLP:

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜