C#面板自动滚屏不起作用 [英] C# Panel autoscroll doesn't work

查看:114
本文介绍了C#面板自动滚屏不起作用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有上有一个图片框的面板。当图片框的内容是太大我要滚动条。我设置自动滚屏设置为true,在面板上。但是,当图片框的内容是那么大面板/ PictureBox的没有滚动条显示的高度。

I have a panel with a picturebox on it. When the content of the picturebox is too large I want scrollbars. I've set the autoscroll set to true on the panel. But when the content of the picturebox is larger then the height of the panel/picturebox no scrollbars are shown.

我的面板被固定上,左,下,右。在PictureBox也是锚上,左,下,右。

My panel is anchored top, left, bottom, right. The picturebox is also anchored top, left, bottom, right.

推荐答案

您必须设置 SizeMode 属性自动调整大小这将导致图片框自动调整到图片的大小。

You'll have to set the SizeMode property to AutoSize which causes the PictureBox to automatically resize to the picture's size.

和我想你应该放下锚,只锚左上角。其余的是由面板照顾的自动。因为否则的PictureBox可能会荣誉锚,暂时无法调整本身比它所包含的面板大 - 同样导致没有滚动条

And I think you should drop the anchors and only anchor to the top left. The rest is taken care of automatically by the panel. Because otherwise the PictureBox would probably honor the anchors, being unable to resize itself larger than the panel it contains – leading to no scrollbars again.

这篇关于C#面板自动滚屏不起作用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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