英語で読む

次の方法で共有


ToolBarTextAlign 列挙型

定義

ツール バー ボタン コントロール上のテキストの配置を指定します。

C#
public enum ToolBarTextAlign
継承
ToolBarTextAlign

フィールド

名前 説明
Right 1

テキストは、ツール バー ボタンのイメージの右側に配置されます。

Underneath 0

テキストは、ツール バー ボタンのイメージの下に配置されます。

次の例では、 コントロールを ToolBar 作成し、その共通プロパティの一部を設定して、 に Form追加します。 デリゲートは、 イベントと ButtonDropDown イベントにも追加されますButtonClick。 この例では、名前付ToolBarき と というtoolBar1名前imageList1ImageList宣言されていることを前提としています。

C#
private void AddToolBar()
{
   // Add a toolbar and set some of its properties.
   toolBar1 = new ToolBar();
   toolBar1.Appearance = System.Windows.Forms.ToolBarAppearance.Flat;
   toolBar1.BorderStyle = System.Windows.Forms.BorderStyle.None;
   toolBar1.Buttons.Add(this.toolBarButton1);
   toolBar1.ButtonSize = new System.Drawing.Size(24, 24);
   toolBar1.Divider = true;
   toolBar1.DropDownArrows = true;
   toolBar1.ImageList = this.imageList1;
   toolBar1.ShowToolTips = true;
   toolBar1.Size = new System.Drawing.Size(292, 25);
   toolBar1.TabIndex = 0;
   toolBar1.TextAlign = System.Windows.Forms.ToolBarTextAlign.Right;
   toolBar1.Wrappable = false;
   
   // Add handlers for the ButtonClick and ButtonDropDown events.
   toolBar1.ButtonDropDown += 
     new ToolBarButtonClickEventHandler(toolBar1_ButtonDropDown);
   toolBar1.ButtonClick += 
     new ToolBarButtonClickEventHandler(toolBar1_ButtonClicked);

   // Add the toolbar to the form.
   this.Controls.Add(toolBar1);
}

注釈

この列挙は、 などの ToolBar.TextAlignメンバーによって使用されます。

Room は、ツール バー ボタンに表示されるイメージ用に予約されています。 テキストの配置は、ツール バー ボタンに表示される画像に関連しています。 ボタンにイメージが割り当てられていない場合は、予約済み領域が左側または表示されているテキストの上に表示されます。

適用対象

製品 バージョン
.NET Framework 1.1, 2.0, 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1
Windows Desktop 3.0

こちらもご覧ください