7月
13
System.Windows.Forms命名空间简介
我们在新建一个Windows窗体应用之后,在Form.cs代码中可以看到一行代码:using System.Windows.Forms。其中using的作用是引入命名空间,而这里我们引入的是System.Windows.Forms命名空间。那么这个System.Windows.Forms命名空间究竟是做什么用的,它其中又包含什么重要的类呢?
System.Windows.Forms命名空间的作用是提供各种控件类,而我们则可以使用这些控件类来创建丰富的用户界面。
在System.Windows.Forms命名空间中,有一个System.Windows.Forms.Control类,这个类的作用是为Form中显示的所有控件提供基本功能。
除此之外,System.Windows.Forms命名空间中还有一个System.Windows.Forms.Form类,这个类的作用则是控制程序内的窗口。