如何在运行时控制窗口大小的用户? [英] How to user control window size fix on Run time?

查看:149
本文介绍了如何在运行时控制窗口大小的用户?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,
我正在使用自定义用户控制窗口.我想在运行时确定用户控件窗口的大小.甚至一个问题)几乎没有意义.毕竟,请查看您自动生成的代码,看看发生了什么.

要更改大小,请使用属性System.Windows.Forms.Control.SizeSystem.Windows.Forms.Control.WidthSystem.Windows.Forms.Control.Height:
http://msdn.microsoft.com/en-us/library/system. windows.forms.control.aspx [ ^ ].

如果您确实需要固定"尺寸,这听起来很可疑.它是错误的,需要修复,您首先需要考虑为什么它是错误的.特别是,应避免使用显式的大小和位置,而应使用对接和Padding.

但是,您真正需要的是:
Microsoft Q209354 .

—SA


Hi all,
I am using custom user control window. I want to fix size of user control window on run time.

解决方案

There is nothing about controls which happens not in run-time, so the question (which is not even a question) makes little to no sense. After all, look at your auto-generated code and see what''s going on.

To change the size, use the properties System.Windows.Forms.Control.Size, System.Windows.Forms.Control.Width and System.Windows.Forms.Control.Height:
http://msdn.microsoft.com/en-us/library/system.windows.forms.control.aspx[^].

If you really need to "fix" the size, it sounds suspicious. It it was wrong and needs fix, you need to think why it''s wrong in first place. In particular, you should avoid using explicit sizes and positions and use docking and Padding.

But what you really need is this:
Microsoft Q209354.

—SA


这篇关于如何在运行时控制窗口大小的用户?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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