winfrom如何修改窗体尺寸
本帖最后由 MartinCorner 于 2013-02-05 19:54:31 编辑
本人新手
只想做一个通过按钮
调制窗体尺寸的“关于”页面
public partial class frmAbout : Form
{
public frmAbout()
{
InitializeComponent();
}
frmAbout about = new frmAbout();
private void frmAbout_Load(object sender, EventArgs e)
{
//about.Width = 414;
//about.Height = 212;
lblAbout.Text = "本软件需要您的支持";
}
//展开按钮
private void btnLog_Click(object sender, EventArgs e)
{
//about.Width = 414;
//about.Height = 406;
//显示开发日志
txtLog.Visible = true;
}
}
结果是报异常
“System.StackOverflowException”类型的未经处理的异常出现在 记账系统.exe 中。
求解决方案
窗体
尺寸
------解决方案--------------------你可以试试,this就代表本窗体了
public partial class frmAbout : Form
{
public frmAbout()
{
InitializeComponent();
}
//frmAbout about = new frmAbout();
private void frmAbout_Load(object sender, EventArgs e)
{
//about.Width = 414;
//about.Height = 212;
lblAbout.Text = "本软件需要您的支持";
}
//展开按钮
private void btnLog_Click(object sender, EventArgs e)
{
//about.Width = 414;
//about.Height = 406;
this.Width = 414;
&nbs