如何在Visual C#Studio 2008中使用两种形式 [英] How to work with two forms in Visual C# Studio 2008

查看:79
本文介绍了如何在Visual C#Studio 2008中使用两种形式的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我必须创建两个表单(Form1和Form2). Form1是主要表单(创建项目时创建的表单).问题是:当您单击Form2时,需要随机更改Form1的大小.我怎样才能做到这一点?任何帮助表示赞赏.

I have to creat two forms (Form1 and Form2). Here Form1 is the main form (that was created when you created the project). The thing is: when you click on the Form2, the size of Form1 need to be random changed. How can I do this? Any help is appreciated. Thanks in advanced!

推荐答案

具有size属性和一个随机数生成器.我相信这门课叫做随机.您可以考虑购买一本书并仔细阅读.
With the size properties and a random number generator. I believe the class is called Random. You may consider buying a book and working through it.


phabion
更改表格大小的一种方法是
Form1.ActiveForm.ClientSize.Width = YourRandomVariableWidth;
khalid sabtan
沙特阿拉伯
Hi phabion
one way to change the size of the form is
Form1.ActiveForm.ClientSize.Width=YourRandomVariableWidth;
khalid sabtan
saudia arabia


这篇关于如何在Visual C#Studio 2008中使用两种形式的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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