开发者

Deriving from a ScrollableControl, is there a way to always have the horizontal scrollbar visible?

Having a custom control deriving from ScrollableControl and using AutoScrollMinSize to set the inner display bigger than the viewport, the horizontal scrollbar shows as expected.

However, sometimes I want the inner display smaller than the viewport but开发者_如何学编程 the horizontal scrollbar disappears. I know that's the expected behavior but what I would like is for the scrollbar to be there but kind of disabled or full.

Is there a way to achieve this?


You could make a panel or label that is 1 pixel wider than your ScrollableControl, anchor it to the right and left so that it stays wider, and make it 0 or 1 pixels tall so that people don't notice it. It's an ugly hack, but it should work.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜