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

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

MenuItem.IsParent プロパティ

メニュー項目に子メニュー項目が含まれているかどうかを示す値を取得します

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

解説解説
使用例使用例

menuItem1 という名前の MenuItem に関連付けられているサブメニューがあるかどうか判断するコード例次に示します。サブメニューが存在する場合は、その Enabled プロパティfalse設定し、それらのサブメニューを無効にます。この例では、menuItem1 という名前の MenuItem作成済みである必要があります

Public Sub DisableMyChildMenus()
    ' Determine if menuItem2 is a parent menu.
    If menuItem2.IsParent = True Then
        ' Loop through all the submenus.
        Dim i As Integer
        For i = 0 To menuItem2.MenuItems.Count
 - 1
            ' Disable all of the submenus of menuItem2.
            menuItem2.MenuItems(i).Enabled = False
        Next i
    End If
End Sub

public void DisableMyChildMenus ()
{
   // Determine if menuItem2 is a parent menu.
   if(menuItem2.IsParent == true)
   {
      // Loop through all the submenus.
      for(int i = 0; i < menuItem2.MenuItems.Count;
 i++)
      {
         // Disable all of the submenus of menuItem2.
         menuItem2.MenuItems[i].Enabled = false;
      }
   }
}

void DisableMyChildMenus()
{
   
   // Determine if menuItem2 is a parent menu.
   if ( menuItem2->IsParent == true )
   {
      
      // Loop through all the submenus.
      for ( int i = 0; i < menuItem2->MenuItems->Count;
 i++ )
      {
         
         // Disable all of the submenus of menuItem2.
         menuItem2->MenuItems[ i ]->Enabled = false;

      }
   }
}

public void DisableMyChildMenus()
{
    // Determine if menuItem2 is a parent menu.
    if (menuItem2.get_IsParent() == true) {

        // Loop through all the submenus.
        for (int i = 0; i < menuItem2.get_MenuItems().get_Count();
 i++) {

            // Disable all of the submenus of menuItem2.
            menuItem2.get_MenuItems().get_Item(i).set_Enabled(false);
        }
    }
} //DisableMyChildMenus
プラットフォームプラットフォーム
バージョン情報バージョン情報
参照参照


このページでは「.NET Framework クラス ライブラリ リファレンス」からMenuItem.IsParent プロパティを検索した結果を表示しています。
Weblioに収録されているすべての辞書からMenuItem.IsParent プロパティを検索する場合は、下記のリンクをクリックしてください。
 全ての辞書からMenuItem.IsParent プロパティ を検索

英和和英テキスト翻訳>> Weblio翻訳
英語⇒日本語日本語⇒英語
  

辞書ショートカット

すべての辞書の索引

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

   

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



MenuItem.IsParent プロパティのページの著作権
Weblio 辞書 情報提供元は 参加元一覧 にて確認できます。

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

©2025 GRAS Group, Inc.RSS