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

ToolStrip クラス

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

Windows ツール バー オブジェクトコンテナ提供します

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

<ClassInterfaceAttribute(ClassInterfaceType.AutoDispatch)> _
<ComVisibleAttribute(True)> _
Public Class ToolStrip
    Inherits ScrollableControl
    Implements IComponent, IDisposable
[ClassInterfaceAttribute(ClassInterfaceType.AutoDispatch)] 
[ComVisibleAttribute(true)] 
public class ToolStrip : ScrollableControl,
 IComponent, IDisposable
[ClassInterfaceAttribute(ClassInterfaceType::AutoDispatch)] 
[ComVisibleAttribute(true)] 
public ref class ToolStrip : public
 ScrollableControl, IComponent, IDisposable
/** @attribute ClassInterfaceAttribute(ClassInterfaceType.AutoDispatch) */ 
/** @attribute ComVisibleAttribute(true) */ 
public class ToolStrip extends ScrollableControl
 implements IComponent, IDisposable
ClassInterfaceAttribute(ClassInterfaceType.AutoDispatch) 
ComVisibleAttribute(true) 
public class ToolStrip extends
 ScrollableControl implements IComponent, IDisposable
解説解説

新しWindows フォーム アプリケーションToolStrip およびその関連クラス使用すると、Windows XPOfficeInternet Explorerツール バー、またはカスタム外観動作を持つツール バー作成できますツール バーの項目はすべて、テーマ付きテーマなしのどちらでも作成でき、オーバーフロー実行時の項目の順番変更サポートしますToolStrip コントロールは、埋め込み編集有効化編集カスタム レイアウト指定した ToolStripContainer 内の空間または垂直空間共有などの、豊富なデザイン時機能も提供します

ToolStrip は、ToolStripButton、ToolStripComboBox、ToolStripSplitButton、ToolStripLabel、ToolStripSeparator、ToolStripDropDownButton、ToolStripProgressBar、および ToolStripTextBox の各オブジェクトコンテナです。

ToolStrip クラスは、描画マウス入力キーボード入力、およびドラッグ アンド ドロップ機能管理するさまざまなメンバ提供しますが、ToolStripManager クラス使用すると、指定した ToolStripContainer 内の ToolStrip コントロール結合してToolStrip コントロール相互にマージできます描画レイアウト スタイルをさらに制御してカスタマイズ性向上させるには、ToolStripRenderer クラスToolStripManager クラスと共に使用します

ToolStrip 内のその他の任意の Windows フォーム コントロールホストするには、ToolStripControlHost クラス使用します

ToolStrip では、以前のバージョンToolBar コントロール機能置換または追加されていますが、下位互換性維持し必要に応じて今後使用できるように、ToolBar残されています。

使用例使用例

次のコード例では、Windows フォームToolStripContainerToolStrip追加し、さらに、ToolStrip に項目を、ToolStripContainer の TopToolStripPanel に ToolStrip追加してます。

Imports System
Imports System.Collections.Generic
Imports System.ComponentModel
Imports System.Data
Imports System.Drawing
Imports System.Text
Imports System.Windows.Forms




Public Class Form1
   Inherits Form
   Private toolStripContainer1 As ToolStripContainer
   Private toolStrip1 As ToolStrip
   
   
   Public Sub New()
      InitializeComponent()
   End Sub 'New
   
   <STAThread()>  _
   Shared Sub Main()
      Application.EnableVisualStyles()
      Application.Run(New Form1())
   End Sub 'Main
   
   
   Private Sub InitializeComponent()
      toolStripContainer1 = New System.Windows.Forms.ToolStripContainer()
      toolStrip1 = New System.Windows.Forms.ToolStrip()
      ' Add items to the ToolStrip.
      toolStrip1.Items.Add("One")
      toolStrip1.Items.Add("Two")
      toolStrip1.Items.Add("Three")
      ' Add the ToolStrip to the top panel of the ToolStripContainer.
      toolStripContainer1.TopToolStripPanel.Controls.Add(toolStrip1)
      ' Add the ToolStripContainer to the form.
      Controls.Add(toolStripContainer1)
   End Sub 'InitializeComponent
 
End Class 'Form1
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;


public class Form1 : Form
{
    private ToolStripContainer toolStripContainer1;
    private ToolStrip toolStrip1;

    public Form1()
    {
        InitializeComponent();
    }
    [STAThread]
    static void Main()
    {
        Application.EnableVisualStyles();
        Application.Run(new Form1());
    }

    private void InitializeComponent()
    {
        toolStripContainer1 = new System.Windows.Forms.ToolStripContainer();
        toolStrip1 = new System.Windows.Forms.ToolStrip();
        // Add items to the ToolStrip.
        toolStrip1.Items.Add("One");
        toolStrip1.Items.Add("Two");
        toolStrip1.Items.Add("Three");
        // Add the ToolStrip to the top panel of the ToolStripContainer.
        toolStripContainer1.TopToolStripPanel.Controls.Add(toolStrip1);
        // Add the ToolStripContainer to the form.
        Controls.Add(toolStripContainer1);
 
    }
}
継承階層継承階層
System.Object
   System.MarshalByRefObject
     System.ComponentModel.Component
       System.Windows.Forms.Control
         System.Windows.Forms.ScrollableControl
          System.Windows.Forms.ToolStrip
             System.Windows.Forms.BindingNavigator
             System.Windows.Forms.MenuStrip
             System.Windows.Forms.StatusStrip
             System.Windows.Forms.ToolStripDropDown
スレッド セーフスレッド セーフ
この型の public static (Visual Basic では Shared) メンバはすべて、スレッド セーフです。インスタンス メンバ場合は、スレッド セーフであるとは限りません。
プラットフォームプラットフォーム
バージョン情報バージョン情報
参照参照
関連項目
ToolStrip メンバ
System.Windows.Forms 名前空間
MenuStrip クラス
ContextMenuStrip クラス
StatusStrip クラス
ToolStripItem
ToolStripDropDown
ToolStripContainer
その他の技術情報
ToolStrip コントロール (Windows フォーム)
ToolStrip サンプル


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

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

辞書ショートカット

すべての辞書の索引

「ToolStrip クラス」の関連用語

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

   

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



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

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

©2025 GRAS Group, Inc.RSS