通过使用C#.Net在运行时调整窗体及其包含的大小 [英] Resize Form and its Containts at Runtime by using C#.Net

查看:82
本文介绍了通过使用C#.Net在运行时调整窗体及其包含的大小的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述


我已经创建了一个固定大小为725,567的Windows窗体.我在那里

按钮,图片框,网格视图,标签,复选框等更多....!
并且无需最大化表单上的大小按钮!
现在客户的要求是,他只想调整表格的大小
在运行时,通过拖动窗体的右角(我标记红条的地方)单击鼠标.
他什么时候会做,
表单的内容将根据表单大小自动设置!
所以请大家给我一个完美的解决方案!
问候...!

Hi,
Already I have created a windows Form with fix size of 725,567. and there i kept
much more buttons,pictureboxes,Gridviews,labels,checkbobes and etc....!
and there is no need to Maximize size Button on the Form!
Now the Client requirement is that, he just want Resize the form
at runtime by click with draging the right corner of the form where i marked the red strips!
and when he will do that,
the containts of the form would be automatically set on the basis of form size!
so please Everybody give me a perfect solution on this requirement!
Regards...!

推荐答案

我相信这是您在1月12日之前提出的问题的转载:

www.codeproject.com/Questions/317633/Manually-add-用户定义的最大化按钮除外

而且,给出该问题的答案也可以回答这个问题.

而且,在设计时,没有什么会阻止您选择(使用Control-click或Click-drag或其他方法)多个任何一种控件,并同时设置其Anchor或Dock属性:尝试一下!

但是,您在表格右下方所指的红色条"是什么?在WinForms中,标准做法是启用窗体的SizeGripStyle属性,该属性将显示在右下角:您可以通过将其设置为显示"来强制使其始终显示.
I believe this is a respost of the question you asked before on January 12:

www.codeproject.com/Questions/317633/Manually-add-user-defined-maximize-button-except-s

And, that the answers given to that question can also answer this one.

And, nothing stops you at design-time in WinForms from selecting (use control-click, or click-drag, or whatever) more than one of any type of Control, and setting their Anchor or Dock properties at the same time: try it !

But, what are the "red strips" you refer to at the right-bottom of the Form ? Standard practice, in WinForms, is to enable the SizeGripStyle property of the Form, which will appear at bottom-right: you can force it to always appear by setting it to ''Show.


您可以通过设置Control的"Dock"和"Anchor"属性来满足您的客户.
在网上阅读有关这些属性的更多信息.
You can satisfy your customers by setting "Dock" and "Anchor" Property of Control.
Read more about these properties on the net.


这篇关于通过使用C#.Net在运行时调整窗体及其包含的大小的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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