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

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

ToolBar.Buttons プロパティ

ツール バー コントロール割り当てられた ToolBarButton コントロールコレクション取得します

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

<LocalizableAttribute(True)> _
Public ReadOnly Property
 Buttons As ToolBarButtonCollection
Dim instance As ToolBar
Dim value As ToolBarButtonCollection

value = instance.Buttons
[LocalizableAttribute(true)] 
public ToolBarButtonCollection Buttons { get;
 }
[LocalizableAttribute(true)] 
public:
property ToolBarButtonCollection^ Buttons {
    ToolBarButtonCollection^ get ();
}
/** @property */
public ToolBarButtonCollection get_Buttons ()
public function get Buttons
 () : ToolBarButtonCollection

プロパティ
ToolBarButton コントロールコレクション格納している ToolBar.ToolBarButtonCollection。

解説解説
使用例使用例

ToolBar3 つの ToolBarButton コントロール作成および初期化するコード例次に示しますツール バー ボタンツール バー割り当てられツール バーフォーム追加されます。このコードは、Form が既に作成されていることを前提にしています。

Public Sub InitializeMyToolBar()
    ' Create and initialize the ToolBarButton controls and ToolBar.
    Dim toolBar1 As New
 ToolBar()
    Dim toolBarButton1 As New
 ToolBarButton()
    Dim toolBarButton2 As New
 ToolBarButton()
    Dim toolBarButton3 As New
 ToolBarButton()
    
    ' Set the Text properties of the ToolBarButton controls.
    toolBarButton1.Text = "Open"
    toolBarButton2.Text = "Save"
    toolBarButton3.Text = "Print"
    
    ' Add the ToolBarButton controls to the ToolBar.
    toolBar1.Buttons.Add(toolBarButton1)
    toolBar1.Buttons.Add(toolBarButton2)
    toolBar1.Buttons.Add(toolBarButton3)
    
    ' Add the ToolBar to the Form.
    Controls.Add(toolBar1)
End Sub

public void InitializeMyToolBar()
 {
    // Create and initialize the ToolBarButton controls and ToolBar.
    ToolBar toolBar1 = new ToolBar();
    ToolBarButton toolBarButton1 = new ToolBarButton();
    ToolBarButton toolBarButton2 = new ToolBarButton();
    ToolBarButton toolBarButton3 = new ToolBarButton();
 
    // Set the Text properties of the ToolBarButton controls.
    toolBarButton1.Text = "Open";
    toolBarButton2.Text = "Save";
    toolBarButton3.Text = "Print";
 
    // Add the ToolBarButton controls to the ToolBar.
    toolBar1.Buttons.Add(toolBarButton1);
    toolBar1.Buttons.Add(toolBarButton2);
    toolBar1.Buttons.Add(toolBarButton3);
 
    // Add the ToolBar to the Form.
    Controls.Add(toolBar1);
 }

public:
   void InitializeMyToolBar()
   {
      // Create and initialize the ToolBarButton controls and ToolBar.
      ToolBar^ toolBar1 = gcnew ToolBar;
      ToolBarButton^ toolBarButton1 = gcnew ToolBarButton;
      ToolBarButton^ toolBarButton2 = gcnew ToolBarButton;
      ToolBarButton^ toolBarButton3 = gcnew ToolBarButton;
      
      // Set the Text properties of the ToolBarButton controls.
      toolBarButton1->Text = "Open";
      toolBarButton2->Text = "Save";
      toolBarButton3->Text = "Print";
      
      // Add the ToolBarButton controls to the ToolBar.
      toolBar1->Buttons->Add( toolBarButton1 );
      toolBar1->Buttons->Add( toolBarButton2 );
      toolBar1->Buttons->Add( toolBarButton3 );
      
      // Add the ToolBar to the Form.
      Controls->Add( toolBar1 );
   }
public void InitializeMyToolBar()
{
    // Create and initialize the ToolBarButton controls and ToolBar.
    ToolBar toolBar1 = new ToolBar();
    ToolBarButton toolBarButton1 = new ToolBarButton();
    ToolBarButton toolBarButton2 = new ToolBarButton();
    ToolBarButton toolBarButton3 = new ToolBarButton();

    // Set the Text properties of the ToolBarButton controls.
    toolBarButton1.set_Text("Open");
    toolBarButton2.set_Text("Save");
    toolBarButton3.set_Text("Print");

    // Add the ToolBarButton controls to the ToolBar.
    toolBar1.get_Buttons().Add(toolBarButton1);
    toolBar1.get_Buttons().Add(toolBarButton2);
    toolBar1.get_Buttons().Add(toolBarButton3);

    // Add the ToolBar to the Form.
    get_Controls().Add(toolBar1);
} //InitializeMyToolBar
プラットフォームプラットフォーム
バージョン情報バージョン情報
参照参照


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

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

辞書ショートカット

すべての辞書の索引

「ToolBar.Buttons プロパティ」の関連用語

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

   

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



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

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

©2025 GRAS Group, Inc.RSS