- Start Visual Studio 2005.
- Click File-> New-> Project.
- In the "Project types" panel on the left, under Visual C# (yes, we're using C# here), expand Smart Device, and select Windows Mobile 5.0 Pocket PC (if you do not see this, check that you install the SDK). In the "Templates" panel, select Device Application.
- Give your project a suitable name, specify a location to save your files, and click OK.
- You should see a PDA skin in the design view. Click on it and press F4 to go to the properties panel. Change the Text property to "My First App". Also, change the Minimize Box property to False. Notice that the little cross at the top-right corner of your form is now an ok button. This ensures that the application is closed when the user clicks on the ok button (as opposed to being minimized and still running in the background).
- Next, drag a Label control and a Button control to the form. Change the Text property of the label to an empty string, and the Text property of the button to "Click Me!"
- Now, double-click on the button that you just added. You should see the Code view.
- Type the following line in the button1_Click method:
- Click Ctrl-F5 to build the application and deploy. When prompted on where to deploy to, select Windows Mobile 5.0 Pocket PC Phone Emulator (or if you prefer, any WM5 Pocket PC emulator, but the phone is the best in my opinion!)
- You should see the emulator running your first app. Click on the button and voila! (To close, click the ok button at the top right to close your app, and close the emulator. When asked to save state, click Yes.)
label1.Text = "Hello World!";
Categories: [Getting started_] Tags: [netcf2] [Compact Framework] [Windows Mobile]