共用方式為


InputLanguage.Handle 屬性

定義

取得輸入語言的控制代碼。

public:
 property IntPtr Handle { IntPtr get(); };
public IntPtr Handle { get; }
member this.Handle : nativeint
Public ReadOnly Property Handle As IntPtr

屬性值

IntPtr

nativeint

IntPtr,表示這個輸入語言的控制代碼。

範例

下列程式碼範例會取得目前的輸入語言。 然後它會呼叫 Handle 以取得控制碼,並在文字方塊中列印結果。 此範例需要 textBox1 已具現化。

public:
   void MyHandle()
   {
      // Gets the current input language.
      InputLanguage^ myCurrentLanguage = InputLanguage::CurrentInputLanguage;
      
      // Gets a handle for the language and prints the number.
      IntPtr myHandle = myCurrentLanguage->Handle;
      textBox1->Text = String::Format( "The handle number is: {0}", myHandle );
   }
public void MyHandle() {
   // Gets the current input language.
   InputLanguage myCurrentLanguage = InputLanguage.CurrentInputLanguage;

   // Gets a handle for the language  and prints the number.
   IntPtr myHandle = myCurrentLanguage.Handle;
   textBox1.Text = "The handle number is: " + myHandle.ToString();
}
Public Sub MyHandle()
   ' Gets the current input language.
   Dim myCurrentLanguage As InputLanguage = InputLanguage.CurrentInputLanguage
       
   ' Gets a handle for the language  and prints the number.
   Dim myHandle As IntPtr = myCurrentLanguage.Handle
   textBox1.Text = "The handle number is: " & myHandle.ToString()
End Sub

適用於

另請參閱