1.打开“Microsoft Visual Studio 2010 Express for Windows Phone”集成开发环境,界面如下图所示:
2.选择File---New Project(或者按Ctrl+Shift+N)---Silverlight for Windows Phone---在右边的选择第一项Windows Phone Application---输出工程名Hello WP7,点击OK
3.完成步骤2后出现下面的界面:
4.按键盘上的F7键就能却换到C#代码,具体的代码如下:
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Net;
- using System.Windows;
- using System.Windows.Controls;
- using System.Windows.Documents;
- using System.Windows.Input;
- using System.Windows.Media;
- using System.Windows.Media.Animation;
- using System.Windows.Shapes;
- using Microsoft.Phone.Controls;
- namespace Hello_WP7
- {
- public partial class MainPage : PhoneApplicationPage
- {
- // Constructor
- public MainPage()
- {
- InitializeComponent();
- //下面这两个语句是自己编写的
- ApplicationTitle.Text = "我的第一个WP7程序";
- PageTitle.Text = "Hello WP7";
- }
- }
- }
5.按F5键进行编译,效果图如下:
本文转自 lingdududu 51CTO博客,原文链接: http://blog.51cto.com/liangruijun/790153