微软.net精简框架常见问题及回答(中文版)(39)

王朝c#·作者佚名  2006-01-09
宽屏版  字体: |||超大  

12. Smartphone

12.1. Where can I get the latest Smartphone SDK?

Download the Windows Mobile 2003 Smartphone SDK here:

http://www.microsoft.com/downloads/details.aspx?familyid=a6c4f799-ec5c-427c-807c-4c0f96765a81&displaylang=en

12.2. What are the rules for smartphone menus?

Smartphone menus have several rules, such as:

the first menu item (corresponding to the left soft button) cannot have any sub items

the second menu item (corresponding to the right soft button) can have sub items

any other top level menu items are not used If the first menu item has more than 1 item, you will get a NotSupportedException.

For a complete list of requirements, refer to the Smartphone help documentation:

ms-help://MS.VSCC.2003/MS.Smartphone2003Help.1033/dv_smartphone/html/spconUsingMenus.htm

The preceding link is referenced from the Windows Mobile 2003 Smartphone SDK:

http://www.microsoft.com/downloads/details.aspx?familyid=a6c4f799-ec5c-427c-807c-4c0f96765a81&displaylang=en

12.3. Why are there disabled controls in the toolbox when creating a Smartphone project?

The smartphone platform only supports a small set of controls. The controls that are not supported are disabled.

For more information, refer to the following Smartphone help documentation:

ms-help://MS.VSCC.2003/MS.Smartphone2003Help.1033/dv_smartphone/html/spconWindowsFormsSupport.htm

The preceding link is referenced from the Windows Mobile 2003 Smartphone SDK:

http://www.microsoft.com/downloads/details.aspx?familyid=a6c4f799-ec5c-427c-807c-4c0f96765a81&displaylang=en

12.4. Does Smartphone support RAM installs of the .NET Compact Framework?

No. The .NET Compact Framework is serviced through operating system updates at the carrier's / OEM's discretion. Therefore, .NET Compact Framework will generally drop as part of larger Windows Mobile for Smartphone operating system updates.

12.5. How do I set the title of a fullscreen multiline edit control window?

This is not supported by the current version of the .NET Compact Framework.

12.6. How can I generate Smartphone CABWizSP XML docs from existing Pocket PC CAB files?

Download Convert PPC DAT to SP XML from Windows Mobile Developer Power Toys:

http://www.microsoft.com/downloads/details.aspx?FamilyId=74473FD6-1DCC-47AA-AB28-6A2B006EDFE9&displaylang=en

12.7. How can I send characters and strings to the Smartphone 2003 Emulator via ActiveSync?

Download TypeIt from Windows Mobile Developer Power Toys:

http://www.microsoft.com/downloads/details.aspx?FamilyId=74473FD6-1DCC-47AA-AB28-6A2B006EDFE9&displaylang=en

12.8. How do I programmatically set the Smartphone input mode?

The input mode can be set using GetFocus and SendMessage APIs according to the code below:

'VB

Imports System.Runtime.InteropServices

Public Const EM_SETINPUTMODE As Integer = &HDE

Public Const EIM_SPELL As Integer = 0

Public Const EIM_AMBIG As Integer = 1

Public Const EIM_NUMBERS As Integer = 2

<DllImport("coredll.dll")> _

Public Shared Function GetFocus() As IntPtr

End Function

<DllImport("coredll.dll")> _

Public Shared Function SendMessage(ByVal hWnd As IntPtr, _

ByVal Message As Integer, ByVal wParam As Integer, _

ByVal lParam As Integer) As Integer

End Function

'Sample use setting TextBox to number input

Private Sub txtAmount_GotFocus(ByVal sender As Object, _

ByVal e As System.EventArgs) Handles txtAmount.GotFocus

Dim hWnd As IntPtr

hWnd = Me.GetFocus()

SendMessage(hWnd, EM_SETINPUTMODE, 0, EIM_NUMBERS)

txtAmount.SelectionStart = txtAmount.Text.Length

End Sub

//C#

using System.Runtime.InteropServices;

public const uint EM_SETINPUTMODE = 0xDE;

public const uint EIM_SPELL = 0;

public const uint EIM_AMBIG = 1;

public const uint EIM_NUMBERS = 2;

[DllImport("coredll.dll")]

public static extern IntPtr GetFocus();

[DllImport("coredll.dll")]

public static extern int SendMessage(IntPtr hWnd,

uint Message, uint wParam, uint lParam);

第一页    上一页    第39页/共78页    下一页    最后页
第01页 第02页 第03页 第04页 第05页 第06页 第07页 第08页 第09页 第10页 
第11页 第12页 第13页 第14页 第15页 第16页 第17页 第18页 第19页 第20页 
第21页 第22页 第23页 第24页 第25页 第26页 第27页 第28页 第29页 第30页 
第31页 第32页 第33页 第34页 第35页 第36页 第37页 第38页 第39页 第40页 
第41页 第42页 第43页 第44页 第45页 第46页 第47页 第48页 第49页 第50页 
第51页 第52页 第53页 第54页 第55页 第56页 第57页 第58页 第59页 第60页 
第61页 第62页 第63页 第64页 第65页 第66页 第67页 第68页 第69页 第70页 
第71页 第72页 第73页 第74页 第75页 第76页 第77页 第78页 
 
 
 
免责声明:本文为网络用户发布,其观点仅代表作者个人观点,与本站无关,本站仅提供信息存储服务。文中陈述内容未经本站证实,其真实性、完整性、及时性本站不作任何保证或承诺,请读者仅作参考,并请自行核实相关内容。
© 2005- 王朝网络 版权所有