ToolStripDropDownMenu クラスとは? わかりやすく解説

Weblio 辞書 > コンピュータ > .NET Framework クラス ライブラリ リファレンス > ToolStripDropDownMenu クラスの意味・解説 

ToolStripDropDownMenu クラス

メモ : このクラスは、.NET Framework version 2.0新しく追加されたものです。

ContextMenuStrip コントロール基本機能提供しますToolStripDropDownMenu および ToolStripDropDown では、以前のバージョンMenu コントロール機能置換および追加されていますが、下位互換性維持し今後必要に応じて使用できるように、Menu保持されています。

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

<ClassInterfaceAttribute(ClassInterfaceType.AutoDispatch)> _
<ComVisibleAttribute(True)> _
Public Class ToolStripDropDownMenu
    Inherits ToolStripDropDown
Dim instance As ToolStripDropDownMenu
[ClassInterfaceAttribute(ClassInterfaceType.AutoDispatch)] 
[ComVisibleAttribute(true)] 
public class ToolStripDropDownMenu : ToolStripDropDown
[ClassInterfaceAttribute(ClassInterfaceType::AutoDispatch)] 
[ComVisibleAttribute(true)] 
public ref class ToolStripDropDownMenu : public
 ToolStripDropDown
/** @attribute ClassInterfaceAttribute(ClassInterfaceType.AutoDispatch) */ 
/** @attribute ComVisibleAttribute(true) */ 
public class ToolStripDropDownMenu extends
 ToolStripDropDown
ClassInterfaceAttribute(ClassInterfaceType.AutoDispatch) 
ComVisibleAttribute(true) 
public class ToolStripDropDownMenu extends
 ToolStripDropDown
解説解説

ToolStripDropDownMenu は、ContextMenuStrip基本クラスで、描画レイアウトに関する必要なプロパティメソッド用意します。このクラスプロパティのうち、直接使用する可能性が最も高いものは、ShowCheckMargin プロパティと ShowImageMargin プロパティです。これらは、ショートカット メニューチェック マークイメージ、またはその両方表示できるかどうか決定します

使用例使用例

チェック マークイメージマージン設定してContextMenuStrip コントロール作成および初期化する方法次のコード例示します。完全なコードの一覧については、「方法 : ContextMenuStrip コントロールチェック余白イメージ余白有効にする」を参照してください

Public Sub New()
   ' Size the form to show three wide menu items.
   Me.Width = 500
   Me.Text = "ToolStripContextMenuStrip: Image
 and Check Margins"
   
   ' Create a new MenuStrip control.
   Dim ms As New MenuStrip()
   
   ' Create the ToolStripMenuItems for the MenuStrip control.
   Dim bothMargins As New
 ToolStripMenuItem("BothMargins")
   Dim imageMarginOnly As New
 ToolStripMenuItem("ImageMargin")
   Dim checkMarginOnly As New
 ToolStripMenuItem("CheckMargin")
   Dim noMargins As New
 ToolStripMenuItem("NoMargins")
   
   ' Customize the DropDowns menus.
   ' This ToolStripMenuItem has an image margin 
   ' and a check margin.
   bothMargins.DropDown = CreateCheckImageContextMenuStrip()
   CType(bothMargins.DropDown, ContextMenuStrip).ShowImageMargin = True
   CType(bothMargins.DropDown, ContextMenuStrip).ShowCheckMargin = True
   
   ' This ToolStripMenuItem has only an image margin.
   imageMarginOnly.DropDown = CreateCheckImageContextMenuStrip()
   CType(imageMarginOnly.DropDown, ContextMenuStrip).ShowImageMargin = True
   CType(imageMarginOnly.DropDown, ContextMenuStrip).ShowCheckMargin = False
   
   ' This ToolStripMenuItem has only a check margin.
   checkMarginOnly.DropDown = CreateCheckImageContextMenuStrip()
   CType(checkMarginOnly.DropDown, ContextMenuStrip).ShowImageMargin = False
   CType(checkMarginOnly.DropDown, ContextMenuStrip).ShowCheckMargin = True
   
   ' This ToolStripMenuItem has no image and no check margin.
   noMargins.DropDown = CreateCheckImageContextMenuStrip()
   CType(noMargins.DropDown, ContextMenuStrip).ShowImageMargin = False
   CType(noMargins.DropDown, ContextMenuStrip).ShowCheckMargin = False
   
   ' Populate the MenuStrip control with the ToolStripMenuItems.
   ms.Items.Add(bothMargins)
   ms.Items.Add(imageMarginOnly)
   ms.Items.Add(checkMarginOnly)
   ms.Items.Add(noMargins)
   
   ' Dock the MenuStrip control to the top of the form.
   ms.Dock = DockStyle.Top
   
   ' Add the MenuStrip control to the controls collection last.
   ' This is important for correct placement in the z-order.
   Me.Controls.Add(ms)
 End Sub
public Form5()
{
    // Size the form to show three wide menu items.
    this.Width = 500;
    this.Text = "ToolStripContextMenuStrip: Image and Check
 Margins";

    // Create a new MenuStrip control.
    MenuStrip ms = new MenuStrip();

    // Create the ToolStripMenuItems for the MenuStrip control.
    ToolStripMenuItem bothMargins = new ToolStripMenuItem("BothMargins");
    ToolStripMenuItem imageMarginOnly = new ToolStripMenuItem("ImageMargin");
    ToolStripMenuItem checkMarginOnly = new ToolStripMenuItem("CheckMargin");
    ToolStripMenuItem noMargins = new ToolStripMenuItem("NoMargins");

    // Customize the DropDowns menus.
    // This ToolStripMenuItem has an image margin 
    // and a check margin.
    bothMargins.DropDown = CreateCheckImageContextMenuStrip();
    ((ContextMenuStrip)bothMargins.DropDown).ShowImageMargin = true;
    ((ContextMenuStrip)bothMargins.DropDown).ShowCheckMargin = true;

    // This ToolStripMenuItem has only an image margin.
    imageMarginOnly.DropDown = CreateCheckImageContextMenuStrip();
    ((ContextMenuStrip)imageMarginOnly.DropDown).ShowImageMargin = true;
    ((ContextMenuStrip)imageMarginOnly.DropDown).ShowCheckMargin = false;

    // This ToolStripMenuItem has only a check margin.
    checkMarginOnly.DropDown = CreateCheckImageContextMenuStrip();
    ((ContextMenuStrip)checkMarginOnly.DropDown).ShowImageMargin = false;
    ((ContextMenuStrip)checkMarginOnly.DropDown).ShowCheckMargin = true;

    // This ToolStripMenuItem has no image and no check margin.
    noMargins.DropDown = CreateCheckImageContextMenuStrip();
    ((ContextMenuStrip)noMargins.DropDown).ShowImageMargin = false;
    ((ContextMenuStrip)noMargins.DropDown).ShowCheckMargin = false;

    // Populate the MenuStrip control with the ToolStripMenuItems.
    ms.Items.Add(bothMargins);
    ms.Items.Add(imageMarginOnly);
    ms.Items.Add(checkMarginOnly);
    ms.Items.Add(noMargins);

    // Dock the MenuStrip control to the top of the form.
    ms.Dock = DockStyle.Top;

    // Add the MenuStrip control to the controls collection last.
    // This is important for correct placement in the z-order.
    this.Controls.Add(ms);
}
継承階層継承階層
System.Object
   System.MarshalByRefObject
     System.ComponentModel.Component
       System.Windows.Forms.Control
         System.Windows.Forms.ScrollableControl
           System.Windows.Forms.ToolStrip
             System.Windows.Forms.ToolStripDropDown
              System.Windows.Forms.ToolStripDropDownMenu
                 System.Windows.Forms.ContextMenuStrip
スレッド セーフスレッド セーフ
この型の public static (Visual Basic では Shared) メンバはすべて、スレッド セーフです。インスタンス メンバ場合は、スレッド セーフであるとは限りません。
プラットフォームプラットフォーム
バージョン情報バージョン情報
参照参照


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

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

辞書ショートカット

すべての辞書の索引

「ToolStripDropDownMenu クラス」の関連用語

ToolStripDropDownMenu クラスのお隣キーワード
検索ランキング

   

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



ToolStripDropDownMenu クラスのページの著作権
Weblio 辞書 情報提供元は 参加元一覧 にて確認できます。

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

©2025 GRAS Group, Inc.RSS