C# 窗口表单
- GUI应用程序将创建以表单为主。
- Windows表单是一种基于公共语言运行时(CLR)创建计算机应用程序的技术。
- Windows窗体应用程序对象存储在库中也称为程序集。
- Windows表单应用程序中使用的两种广泛类别的对象:表单和控件。
- Windows表单提供了一系列名为Windows控件的对象或者简单地控制。这些控件已通过各种类在.NET Framework中创建。
- Windows表单基于在System.Windows.Forms.dll程序集中创建的系统:: Windows :: Forms命名空间中定义的表单类。
C# 表单窗口示例
下面的示例演示了如何更改Form1的标题,BackColor,大小,位置和MaximizeBox属性。
using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Linq; using System.Text; using System.Windows.Forms; namespace WindowsFormsApplication2 { public partial class Form1 : Form { public Form1() { InitializeComponent(); } private void Form1_Load(object sender, EventArgs e) { this.Text="C#窗口"; this.Size=new Size(400,150); this.Location=new Point(400,400); this.MaximizeBox=false; this.BackColor = Color.Gray; } } }
日期:2020-04-11 23:03:39 来源:oir作者:oir