面板中的ScrollBar ..... [英] ScrollBar in Panel.....

查看:92
本文介绍了面板中的ScrollBar .....的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要一个面板中的滚动条(水平和垂直),没有自动滚动,因为我希望该面板以显示的滚动条开始并具有最大值和最小值...使用WinForms

解决方案

如果你问的是当你在WinForms中的Panel Control中没有内容时会如何强制滚动条出现,这会强制显示滚动条它的'AutoScroll属性'是真的:



设置面板的'AutoScrollMinSize属性的宽度和高度值大于面板的宽度和高度。


我现在从内存开始,所以你需要检查,但是Panel是从ScrollableControl派生的。这意味着它应该具有方法/属性(我不记得名称)来设置自动滚动模式和范围。我在过去开发控件时已经使用过这些。



如果你找不到它们,请给我留言,我会看看。

试试这个



panel.VerticalScroll.Visible = true

panel.Horizo​​ntalScroll.Visible = true



来源 - http://social.msdn.microsoft.com/Forums/en-US/b6d708bf-da6a-4f77-afa2-eccee177a316/show-scrollbar-in-panel [<一个href =http://social.msdn.microsoft.com/Forums/en-US/b6d708bf-da6a-4f77-afa2-eccee177a316/show-scrollbar-in-paneltarget =_ blanktitle =New Window > ^ ]

I need a scrollbar (horizontal and vertical) in a panel, without autoscroll because i want that panel starts with the scrollbar displayed and have a max and min value... Using WinForms

解决方案

If what you are asking is how do you force scrollbars to appear when a Panel Control in WinForms does not have "content" in it that would force scroll-bars to appear if its 'AutoScroll Property was 'true:

Set the Width and Height values of the 'AutoScrollMinSize Property of the Panel greater than the Width and Height of the Panel.


Right I'm going from memory here so you'll need to check, but Panel is derived from ScrollableControl. This means it should have methods/properties (I can't remember the names) to set the autoscroll mode, and the extent. I've used these when developing controls in the past.

Drop me a line if you can't find them and I'll have a look.


Try this

panel.VerticalScroll.Visible = true
panel.HorizontalScroll.Visible = true

Source - http://social.msdn.microsoft.com/Forums/en-US/b6d708bf-da6a-4f77-afa2-eccee177a316/show-scrollbar-in-panel[^]


这篇关于面板中的ScrollBar .....的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆