在vb.net中调整面板内部的控件大小 [英] Resizing Control inside the Panel in vb.net
本文介绍了在vb.net中调整面板内部的控件大小的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
Form1有1个面板,并且Panel1的内部有标签,图片框和文本框.
我想要一个程序,当我更改面板的大小时,其中的所有控件也会更改其字体大小.例如图片放大和缩小.
感谢所有评论/建议.
Form1 has 1 panel, and inside of the Panel1 there are labels, picturebox, and textbox.
I want a program that when i change the size of the panel all controls inside of it also change their font size. like picture zoom in and zoom out.
Thanks for all comments/suggestion.
推荐答案
如果您使用的是System.Windows.Forms
,请使用Dock = DockStile.Fill
,请参见:
http://msdn.microsoft.com/en-us/library/system.windows.forms.control.dock.aspx [ ^ ],
http://msdn.microsoft.com/en-us/library/system. windows.forms.dockstyle.aspx [ ^ ].
通过System.Windows.Forms.Control.Padding
使用它进行一些填充.
如果这些面板上有许多控件,则将所有内容安排在某些层次插入的垫"面板中,这些面板结合了不同的底座样式.需要一些练习.这是获取表格的灵活布局,使其具有尺寸/分辨率公差的一种主要方法.
请参阅 http://msdn.microsoft.com/en-us/library/system .windows.forms.control.aspx [ ^ ].
请查看我过去关于以下主题的答案:
当屏幕分辨率改变时,Zom Out发生故障 [ ^ ],
GUI外观-C#.Net [如何停靠按钮,以便它可以使用以下格式进行调整 [
If you are usingSystem.Windows.Forms
, useDock = DockStile.Fill
, please see:
http://msdn.microsoft.com/en-us/library/system.windows.forms.control.dock.aspx[^],
http://msdn.microsoft.com/en-us/library/system.windows.forms.dockstyle.aspx[^].
Use it with some padding throughSystem.Windows.Forms.Control.Padding
.
If you have many controls on these panel, arrange everything in some hierarchically inserted "pad" panels combining different dock style. In need some practice. This is a main way to get flexible layout of the form, to make it size/resolutions-tolerant.
See http://msdn.microsoft.com/en-us/library/system.windows.forms.control.aspx[^].
Please see my past answers on the topic:
Zom Out malfunctions when Screen resolution changes[^],
GUI Apperance - C#.Net[^],
how to dock button so that it can adjust with the form[^] (rudimentary code sample here).
—SA
这里是一个教程-适用于C#,但这不应该是问题...对吗?
http://www.switchonthecode.com/tutorials/csharp-tutorial-font-scaling [ ^ ]
Here''s a tutorial - it''s for C# but that shouldn''t be a problem... Right?
http://www.switchonthecode.com/tutorials/csharp-tutorial-font-scaling[^]
这篇关于在vb.net中调整面板内部的控件大小的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文