如何在 C# 中更改表单的颜色和大小?
// something like
Form1.BackColor = Color.Red;
From1.size = 1600,900;
this.BackColor = Color.Red;
this.Size = new Size(1600, 900);
如果您正在创建表单的实例:
Form1 form = new Form1();
form.BackColor = Color.Red;
form.Size = new Size(1600,900);
form.Show();
Form1.BackColor = Color.Red;
Form1.Size = New System.Drawing.Size(1600, 900);
Form1.Invalidate();
无效将导致表单重绘自身
this.BackColor = System.Drawing.Color.Red
this.Size = new Size(100, 100)