如何调整窗口窗体的大小 [英] how to resize the window forms

查看:116
本文介绍了如何调整窗口窗体的大小的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在处理窗口窗体.在我的winform中,我有组框和文本框.当我运行我的应用程序并最大化winform窗口时,如何根据窗口的大小调整组框和文本框的大小

i am working on a window form.in my winform i have groupboxes and textboxes .when i run my application and maximize the winform window how can i get my groupboxes and textboxes resized according to the size of window

推荐答案

请参阅以下内容,可能会有所帮助:
http://stackoverflow. com/questions/1603526/how-can-i-make-a-control-resize-itself-when-the-window-is-maximize [ ^ ]

如果以上链接没有帮助:
有时您可能需要编写代码来设置与窗口大小成比例的大小.
获取您的窗口大小,并据此找出一些公式来调整网格大小.
See this, it may help:
http://stackoverflow.com/questions/1603526/how-can-i-make-a-control-resize-itself-when-the-window-is-maximized[^]

If above link doesn''t help:
Some times you may have to write code to set the size proportional to window size.
Get your window size and accordingly figure out some formula to resize the grid.


这是我猜的一种方法:
http://stackoverflow.com/Questions/4248637/how-to-auto-re-resize-and-adjust-form-controls-with-change-in-resolution [ http://www.techrepublic.com/article/manage-winform-controls-using-the-anchor-and-dock-properties/6165908 [ http://msdn.microsoft.com/zh-cn/library/microsoft.win32.systemevents.displaysettingschanged%28v = VS.100%29.aspx [
Here is one way I guess:
http://stackoverflow.com/questions/4248637/how-to-auto-resize-and-adjust-form-controls-with-change-in-resolution[^]

http://www.techrepublic.com/article/manage-winform-controls-using-the-anchor-and-dock-properties/6165908[^]

And you have an event that fires with a change in WinForm:
http://msdn.microsoft.com/en-us/library/microsoft.win32.systemevents.displaysettingschanged%28v=VS.100%29.aspx[^]
Meaning you could hard code it :) This is much easyer in WPF though..


通常的方法是相对于所有四个方面设置Anchor属性,但是,可能不行如果控件变得太小,则给出预期的结果.
The normal way is to set the Anchor properties relative to all four sides, however, that may not give the expected results if the controls become too small.


这篇关于如何调整窗口窗体的大小的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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