您的位置:首页 > 编程语言 > C#

C# 窗体简介

2017-02-05 09:06 239 查看
窗体简介

C#窗体编辑界面(VS2010)



其中主要包括工具箱、资源管理器、属性和用于显示和编辑的部分(如果没有的话可以在视图菜单中调整)

资源管理器中:



1、其中Form1.cs中包括一些窗体的设计

2、Program.cs中是窗体的主函数

程序是从main中开始的,C#窗体不例外:using System;
using System.Collections.Generic;
using System.Linq;
using System.Windows.Forms;

namespace window_Text
{
static class Program
{
/// <summary>
/// 应用程序的主入口点。
/// </summary>
[STAThread]
static void Main()
{
Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(false);
Application.Run(new Form1());
}
}
}


上面是Program.cs中的代码,其中using System.Windows.Forms;是一个命名空间,如果要做窗体必须要用这个命名空间
上面的Application.Run(new Form1());这句话的意思是运行窗体程序
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: