Windows 窗体锚点,使面板内的控件保持相同的比例?
我有这个面板,里面有 2 个 PictureBox,它们都锚定在屏幕的所有边缘:
这就是它的方式看起来最小的屏幕尺寸。 (好)
现在这是我将屏幕调整到更大尺寸后的样子:
如您所见 1 PictureBox覆盖另一个... 我尝试了很多类型的锚点和码头..
但仍然在调整大小时一切都搞砸了.. 我怎样才能保持它们之间的比例?
那么,当屏幕变大时,它们都会同等地变大,看起来像第一张图片中的那样,但更大?
C# .NET 3.5 Windows Forms
更新:
好的,我使用 tableLayoutPanel
现在看起来像这样:
调整大小后,它看起来像这样:
您可能会认为这很好,但你可以看到它没有保留比例..
不,我没有宽屏.. 我有一个 19 英寸屏幕 1280 x 1024
那么为什么会发生这种情况呢?
I have this Panel with 2 PictureBoxs inside, they are both Anchored too all edges of the screen:
This is how it looks on minimum screen size. (Good)
Now this is how it look after i resize the screen to a bigger size:
As you see 1 PictureBox overides another...
I tried lots of kindes of anchros and docks..
but still on resize it's all f***ed up..
How can i keep the ratio between them?
So when the screen get bigger they both get bigger equally and looks like in the first picture but larger?
C# .NET 3.5 Windows Forms
UPDATE:
Ok i use tableLayoutPanel
now it looks like that:
And after resizing it looks like that:
You might think it's good, but you can see it didn't preserve the ratio..
And no i dont have a Wide Screen.. i have a 19" Screen on 1280 x 1024
So why does it heppend?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
只是不要绑定底部面板的向上
锚
。但更好的方法是使用SplitContainer
或TableLayoutPanel
控件来拆分面板。Just don't bind the bottom panel's Up
Anchor
. But the better way is to useSplitContainer
orTableLayoutPanel
control to split your pannel.