MainMenu.RightToLeft プロパティとは? わかりやすく解説

Weblio 辞書 > コンピュータ > .NET Framework クラス ライブラリ リファレンス > MainMenu.RightToLeft プロパティの意味・解説 

MainMenu.RightToLeft プロパティ

コントロールがテキストを右から左に表示するかどうかを取得または設定します。

名前空間: System.Windows.Forms
アセンブリ: System.Windows.Forms (system.windows.forms.dll 内)
構文構文

<LocalizableAttribute(True)> _
Public Overridable Property
 RightToLeft As RightToLeft
Dim instance As MainMenu
Dim value As RightToLeft

value = instance.RightToLeft

instance.RightToLeft = value
[LocalizableAttribute(true)] 
public virtual RightToLeft RightToLeft { get;
 set; }
/** @property */
public RightToLeft get_RightToLeft ()

/** @property */
public void set_RightToLeft (RightToLeft value)

プロパティ値
RightToLeft 値の 1 つ。

例外例外
例外の種類条件

InvalidEnumArgumentException

プロパティに割り当てられた値が RightToLeft 列挙体の有効なメンバではありません。

解説解説
使用例使用例

GetForm メソッドを使用して、MainMenu の現在の親がそのフォームかどうかを判断するコード例を次に示します。このコード例で呼び出されている GetForm が null 参照 (Visual Basic では Nothing) 値を返さない場合、このコードは、CloneMenu メソッドを使用して、MainMenu のメニュー構造のクローンを作成します。次に、MainMenu の新しいコピーの RightToLeft プロパティを RightToLeft.Yes に設定し、テキストが右から左に表示される言語に対応した MainMenu を作成します。この例では、mainMenu1 という名前の MainMenu が作成されている必要があります。

Public Sub CloneMyMenu()
    ' Determine if mainMenu1 is currently hosted on the form.
    If Not (mainMenu1.GetForm() Is
 Nothing) Then
        ' Create a copy of the MainMenu that is hosted on the form.
        Dim mainMenu2 As MainMenu = mainMenu1.CloneMenu()
        ' Set the RightToLeft property for mainMenu2.
        mainMenu2.RightToLeft = RightToLeft.Yes
    End If
End Sub

public void CloneMyMenu()
{
   // Determine if mainMenu1 is currently hosted on the form.
   if(mainMenu1.GetForm() != null)
   {
      // Create a copy of the MainMenu that is hosted on the form.
      MainMenu mainMenu2 = mainMenu1.CloneMenu();
      // Set the RightToLeft property for mainMenu2.
      mainMenu2.RightToLeft = RightToLeft.Yes;
   }
}

void CloneMyMenu()
{
   // Determine if mainMenu1 is currently hosted on the form.
   if ( mainMenu1->GetForm() != nullptr )
   {
      // Create a copy of the MainMenu that is hosted on the form.
      MainMenu^ mainMenu2 = mainMenu1->CloneMenu();

      // Set the RightToLeft property for mainMenu2.
      mainMenu2->RightToLeft = ::RightToLeft::Yes;
   }
}
public void CloneMyMenu()
{
    // Determine if mainMenu1 is currently hosted on the form.
    if (mainMenu1.GetForm() != null) {

        // Create a copy of the MainMenu that is hosted on the form.
        MainMenu mainMenu2 = mainMenu1.CloneMenu();

        // Set the RightToLeft property for mainMenu2.
        mainMenu2.set_RightToLeft(get_RightToLeft().Yes);
    }
} //CloneMyMenu
プラットフォームプラットフォーム
バージョン情報バージョン情報
参照参照



英和和英テキスト翻訳

英語⇒日本語日本語⇒英語

辞書ショートカット

すべての辞書の索引

MainMenu.RightToLeft プロパティのお隣キーワード
検索ランキング

   

英語⇒日本語
日本語⇒英語
   



MainMenu.RightToLeft プロパティのページの著作権

   
日本マイクロソフト株式会社日本マイクロソフト株式会社
© 2026 Microsoft.All rights reserved.

©2026 GRAS Group, Inc.RSS