vs2012,新建winform应用程序,第一个练习,空白窗体。
app.config
<?xml version="1.0" encoding="utf-8" ?> <configuration> <startup> <supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5" /> </startup> </configuration>
program.cs
using System; using System.Collections.Generic; using System.Linq; using System.Threading.Tasks; using System.Windows.Forms; namespace XNAGame_001 { static class Program { /// <summary> /// 应用程序的主入口点。 /// </summary> [STAThread] static void Main() { Application.EnableVisualStyles(); Application.SetCompatibleTextRenderingDefault(false); Application.Run(new Form1()); } } }
form1.cs
using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Linq; using System.Text; using System.Threading.Tasks; using System.Windows.Forms; namespace XNAGame_001 { public partial class Form1 : Form { public Form1() { InitializeComponent(); } } }
大家注意,以上代码均是vs自动生成的,没有添加一行手动的代码,目的是开始学习游戏页游等的开发,先熟悉一下windows应用程序开发。