Scrolling panel using horizontal scroll bar

南楼画角 提交于 2019-12-12 15:13:59

问题


How can I apply a horizontal scroll bar to a Panel?

I'm working on 2d tiled map editor and I'm using a Panel to hold the contents. When my map is bigger than my panel it just goes off and becomes invisible, would it be possible to apply custom scroll bars?


回答1:


The Panel is derived from ScrollableControl. So there is a property AutoScroll. Just set it to true and the rest will be done automagically.




回答2:


While this no longer applies as the question has been clarified to target winforms, in Web Forms you can set the ScrollBars property to ScrollBars.Horizontal.



来源:https://stackoverflow.com/questions/3452612/scrolling-panel-using-horizontal-scroll-bar

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!