Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
有什么方法可以反转此代码,以便用户可以通过文本框条目设置窗口窗体的宽度/高度?
textBox1.Text = this.Width.ToString();
我正在用 C# 编码
您可以通过设置表单的边界来尝试
this.Bounds = new Rectangle(0,0,Width,Height);
传入从 中捕获的Widthand这应该可以帮助您设置表单高度宽度。HeightTextBox
Width
Height
TextBox