共用方式為


InputLanguage.LayoutName 屬性

定義

取得出現在電腦作業系統地區設定的目前鍵盤配置名稱。

public:
 property System::String ^ LayoutName { System::String ^ get(); };
public string LayoutName { get; }
member this.LayoutName : string
Public ReadOnly Property LayoutName As String

屬性值

配置名稱。

範例

下列程式碼範例會取得與目前輸入語言相關聯的文化特性,並顯示文化特性名稱。

首先, CurrentInputLanguage 呼叫 以取得目前的輸入語言。 然後, Culture 會呼叫 來取得此輸入語言的文化特性資訊。 最後, EnglishName 會擷取並顯示在文字方塊中。

public:
   void MyLayoutName()
   {
      // Gets the current input language.
      InputLanguage^ myCurrentLanguage = InputLanguage::CurrentInputLanguage;

      if ( myCurrentLanguage != nullptr )
      {
         textBox1->Text = String::Format( "Layout: {0}", myCurrentLanguage->LayoutName );
      }
      else
      {
         textBox1->Text = "There is no current language";
      }
   }
public void MyLayoutName() {
   // Gets the current input language.
   InputLanguage myCurrentLanguage = InputLanguage.CurrentInputLanguage;

   if(myCurrentLanguage != null) 
      textBox1.Text = "Layout: " + myCurrentLanguage.LayoutName;
   else
      textBox1.Text = "There is no current language";
}
Public Sub MyLayoutName()
   ' Gets the current input language.
   Dim myCurrentLanguage As InputLanguage = InputLanguage.CurrentInputLanguage
       
   If (myCurrentLanguage IsNot Nothing) Then
      textBox1.Text = "Layout: " & myCurrentLanguage.LayoutName
   Else
      textBox1.Text = "There is no current language"
   End If
End Sub

適用於

另請參閱