在vb.net中设计GUI [英] designing GUI in vb.net

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

问题描述

你好,我只需要一些建议如何使用vb.net在Visual Studio 2012中布局我的GUI。

如果我放置按钮文本框等,在普通视图中它看起来很好,但是当你最大化GUI内容没有相应调整的形式,它们只是放在我放置的位置?



如何调整我的winForm应用程序?





基本上我有两种形式,第一种是带有按钮的列表框。第二个表单的形式有一个自定义的背景图像1x面板....面板停靠填充....和一个标签...当应用程序启动时,form2加载到扩展屏幕上.....所以你当用户从列表框中单击一个选项并单击按钮时,看到的是第二个显示器上的背景图像....列表框中的文本加载到表单2上的标签....但是标签的位置确实如此不改变,它没有调整大小.....在设计模式中,form2是453,380维......但是当app运行时我有最大化的选项....所以它在加载时填充屏幕.. ..我设计模式标签看起来像填充form2 ...但是当它在左上角运行时,与屏幕尺寸相比较小。



i想要基于从列表框传递的文本数量,form2中的标签调整大小并填充尽可能多的屏幕......在lisbox中,文本在1行到7行文本之间不同。

***设置标签背景透明,这样你仍然可以查看背景图片。

hello, i just need some advise on how to layout my GUI in Visual Studio 2012 using vb.net.
if i place button textbox etc, when in normal view it looks fine, but when you maximize the form the GUI content does not adjust accordingly, they just stay where i placed them?

how can i get my winForm app to adjust?


basically i have two forms, the first 1 has listbox with a button. the second form has the form with a custom background image 1x panel ....panel docked to fill....and a label... when application is launched form2 is loaded onto the extended screen.....so all you see is the background image on your second monitor, when the user click a choice from the listbox and click the button....the text from the listbox loads into the label on form 2.... however the postion of the label does not change, it does not resize..... in design mode form2 is 453, 380 dimensions.....but when app is run i have the maximised option on....so it fills the screen when loaded.... i design mode the label appears to fill form2 horizontially....but when run its just in the top left and small compared to the screen size.

i want the label in form2 to resize and fill as much of the screen as poosible, based on the amount of text passed from the listbox......in the lisbox the text various between 1 line to 7 lines of text.
*** label background is set to transparent, so that you can still view the background image.

推荐答案

...正如上面的海报已经说过 - 你需要看看Dock和锚点属性。



查看 *这个ariticle * 作为解释。
... as the above posters have already said - you need to have a look at Dock and Anchor properties.

Check out * this ariticle * for an explanation.






我认为你应该探索控件的Dock和Anchor属性。希望这能做你想做的事。





你需要做的是,

1在设计时将标签的大小设置为等于形式,并将Label的Anchor属性设置为left,top和Right,它将拉伸你的标签,因为你的形式会拉伸。

2.第二种方式,如果标签必须在表格2的顶部:只需将标签的Dock属性设置为TOP。







- RKS
Hi,

I think you should explore Dock and Anchor properties of control. Hope this will do what you want to do.


What you need to do is,
1. On design time set the size of label to equal to form and set Anchor property of Label to left, top and Right it will stretch you label as much as you form will stretch.
2. Second way of doing this thing, if label has to be on top of the Form 2: Just set Dock property of label to TOP.



-- RKS


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

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