-7

如何在 C# 中更改表单的颜色和大小?

  // something like
  Form1.BackColor = Color.Red;  
  From1.size = 1600,900;
4

4 回答 4

5
this.BackColor = Color.Red;
this.Size = new Size(1600, 900);
于 2012-08-01T16:58:18.220 回答
1

如果您正在创建表单的实例:

Form1 form = new Form1();

form.BackColor = Color.Red;
form.Size = new Size(1600,900);

form.Show();
于 2012-08-01T16:59:35.797 回答
1
 Form1.BackColor = Color.Red;
 Form1.Size = New System.Drawing.Size(1600, 900);
 Form1.Invalidate();

无效将导致表单重绘自身

于 2012-08-01T17:01:29.730 回答
0
this.BackColor = System.Drawing.Color.Red
this.Size = new Size(100, 100)
于 2012-08-01T16:59:10.263 回答