Introduction to creating your first Windows Mobile program using Visual Studio 2008

Source: Internet
Author: User

Create your first Windows Mobile program with Visual Studio 2008 Introduction to Windows Mobilemobilewindowsmicrosoftwinform

Introduced

Microsoft Visual Studio 2008 Pro or later provides a Windows Mobile program development environment that allows you to use native code (c/D + +) or managed code (C #/Visual Basic.NET) for Windows Mo Bile device creation program.

This article will take you to the correct installation of Visual Studio 2008 and the additional Windows Mobile SDK, and then we will create the first Windows Mobile program, which is the target device for Windows Mobile 6. It will also show you how to use the Device Emulator to help you test your Windows Mobile program without having to have a Windows Mobile device.

Installing Visual Studio 2008 and attaching the Windows Mobile SDK

We assume that you already have a computer that you want to use to develop Windows Mobile programs, first we install Visual Studio 2008 and MSDN, and if you don't have Visual Studio 2008, you can download an evaluation version of it on Microsoft's website. Microsoft Visual Studio Professional, for: http://msdn.microsoft.com/en-us/vstudio/products/ Aa700831.aspx, if you are using the. ISO version, install the virtual CD-ROM, load the ISO into the virtual CD-ROM, and if you buy a DVD disc, put it in the DVD drive, you will see the Installation Wizard, and you will be able to install the visual with the default settings. Studio 2008 and MSDN.

Next we need to install the latest update for Visual Studio 2008, the current update package is: Visual Studio Service Pack 1, as: http://www.microsoft.com/downloads/ Details.aspx? familyid=fbee1648-7106-44a7-9649-6d9f6d58056e&displaylang=en, please download after installation, because the file is large, it may take some time.

So far, you've successfully installed Visual Studio 2008, which you can use to develop ASP. NET, WinForm, and smart Device programs (you can only develop Windows Mobile 5.0 programs) If you need to develop Windows Mobile 6 programs on your device, you will also need to install the Windows Mobile 6 SDK and the Windows Mobile 6 emulator, as follows:

Windows Mobile 6 Professional and standard software development Kits Refresh:
http://www.microsoft.com/downloads/details.aspx?FamilyID=06111A3A-A651-4745-88EF-3D48091A390B&displaylang=en
Note: The Windows Mobile 6 Professional SDK Refresh.msi is used to develop Windows Mobile programs that use touch screens.
The Windows Mobile 6 standard SDK Refresh.msi is used to develop Windows Mobile programs that use the keyboard.

Windows Mobile 6 Localized Emulator Images
http://www.microsoft.com/DOWNLOADS/details.aspx?FamilyID=38c46aa8-1dd7-426f-a913-4f370a65a582&displaylang=en

Below is the emulator for Windows Mobile 6.1, which is interesting to download from the following links:
Windows Mobile 6.1.4 Emulator Images
Http://www.microsoft.com/downloads/details.aspx?FamilyID=1A7A6B52-F89E-4354-84CE-5D19C204498A&displaylang=en#Overview
Note: Windows Mobile 6.1.4 Professional Images (USA). msi simulates a Windows Mobile 6.1 system that uses a touchscreen.
Windows Mobile 6.1.4 Standard Images (USA). msi simulates a Windows Mobile 6.1 system that uses a keyboard.

When this article was published, the Emulator for Windows Mobile 6.5 has been released, and if you are interested, you can download it at the following address:
Windows Mobile 6.5 Developer Tool Kit
http://www.microsoft.com/downloads/details.aspx?FamilyID=20686A1D-97A8-4F80-BC6A-AE010E085A6E&displaylang=en

After downloading the above program, please install the Windows Mobile SDK, install the simulator, follow the prompts during installation, install it, and we will be ready to complete.


Create your first Windows Mobile program

Create a new Smart Device project
1. Open Microsoft Visual Studio 2008.
2. On the File menu, click New, select Project.
3. In project type, select Visual C #, select Smart Device.
4. Specify a new name Hellomobile, location, and solution name Hellomobile, click OK.


9. Modify the Form1 property text to "Hello Mobile" and the MinimizeBox property to False.
10. Drag a button from the Toolbox into the Form1 to change the name to "Btnhello" in the property bar and change the text to "Hello".
11, from the Toolbox to Form1 drag into a lable in the property bar to change the name to "Lblinfo", the text is changed to empty.
12, double-click Btnhello, write the following code:
private void Btnhello_click (object sender, EventArgs e)
{
Lblinfo.text = "Hello Mobile"
+ ", click at:"
+ DateTime.Now.ToLongTimeString ();
}

Compile and publish your program

13. Select Windows Mobile 6 Professional Emulator in the target device list, and in the Build menu, choose Build Solution.
14. In the Debug menu, select Start Debugging, select Windows Mobile 6 Professional Emulator, click Deploy, Visual Studio 2008 will help to deploy our program to the simulator, the program will open in the emulator after the deployment is completed.

Test your Program

15. Click the Hello button to check if the text of the scheduled rule is displayed on the Lblinfo control.


16. Click OK to close the application.
17. Close the simulator and select Save Status and exit from the File menu.
18. Stop debugging in Visual Studio 2008 and close the Hellomobile solution.
19. Close Visual Studio 2008.


5. Select the Windows Mobile 6 Professional SDK on the target platform.
6. Select the. NET Compact Framework version 3.5 in the. NET Compact Framework release list.
7. Select the device application in the template.


8. Click OK Visual Studio 2008 will help us create a hellomobile device application and generate a default form FORM1, such as:

Introduction to creating your first Windows Mobile program using Visual Studio 2008

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.