InputPanel.CurrentInputMethod 属性
获取或设置 Pocket PC 的输入法。
命名空间: Microsoft.WindowsCE.Forms
程序集: Microsoft.WindowsCE.Forms(在 Microsoft.WindowsCE.Forms.dll 中)
语法
声明
Public Property CurrentInputMethod As InputMethod
用法
Dim instance As InputPanel
Dim value As InputMethod
value = instance.CurrentInputMethod
instance.CurrentInputMethod = value
public InputMethod CurrentInputMethod { get; set; }
public:
property InputMethod^ CurrentInputMethod {
InputMethod^ get ();
void set (InputMethod^ value);
}
public function get CurrentInputMethod () : InputMethod
public function set CurrentInputMethod (value : InputMethod)
属性值
类型:Microsoft.WindowsCE.Forms.InputMethod
一个表示输入法的对象。
备注
可以将此属性设置为设备上可用的任何一种输入法。
示例
下面的示例将此属性设置为在列表框中选定的一种方法。此示例摘自为 InputPanel.InputMethodCollection 类提供的一个更大的示例。
' This event handler iterates through the
' InputMethodCollection and sets the input method
' to the input method selected in the list box.
' When a member of the collection is the
' same the selected value in the list box, that
' method is set to the current input method.
Private Sub ListBox1_SelectedIndexChanged(sender As Object, e As EventArgs) Handles ListBox1.SelectedIndexChanged
' Get the selected input method from the list box.
Dim strIM As String
strIM = ListBox1.SelectedItem.ToString()
' Iterate through the input method collection.
' When there is a match with the input method
' selected in the list box, set the
' CurrentInputMethod property to the selected method.
Dim im As InputMethod
For Each im In InputPanel1.InputMethods
If im.Name = strIM Then
' Change the input method.
InputPanel1.CurrentInputMethod = im
End If
Next im
End Sub
// Get the selected input method from the list box.
string strIM;
strIM = listBox1.SelectedItem.ToString();
// Iterate through the input method collection.
// When there is a match with the input method
// selected in the list box, set the
// CurrentInputMethod property to the selected method.
foreach (InputMethod im in ip.InputMethods)
{
if (im.Name == strIM)
// Change the input method.
ip.CurrentInputMethod = im;
}
权限
- 对直接调用方的完全信任。此成员不能由部分信任的代码使用。有关更多信息,请参见通过部分受信任的代码使用库。
平台
Windows CE, Windows Mobile for Pocket PC
.NET Framework 和 .NET Compact Framework 并不是对每个平台的所有版本都提供支持。有关支持的版本的列表,请参见.NET Framework 系统要求。
版本信息
.NET Compact Framework
受以下版本支持:3.5、2.0