ToolStripItem.ImageAlign プロパティ

定義

ToolStripItem 上のイメージの配置を取得または設定します。

public:
 property System::Drawing::ContentAlignment ImageAlign { System::Drawing::ContentAlignment get(); void set(System::Drawing::ContentAlignment value); };
public System.Drawing.ContentAlignment ImageAlign { get; set; }
member this.ImageAlign : System.Drawing.ContentAlignment with get, set
Public Property ImageAlign As ContentAlignment

プロパティ値

ContentAlignment

ContentAlignment 値のいずれか 1 つ。 既定値は、MiddleLeft です。

例外

代入された値が、ContentAlignment 値ではありません。

次のコード例ではImageTextAlign ImageAlignDisplayStyle ToolStripButton、. この例は、クラスの概要で使用できるより大きな例の ToolStripButton 一部です。

this.toolStripButton1.Image = Bitmap.FromFile("c:\\NewItem.bmp");
this.toolStripButton1.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.ImageAndText;
this.toolStripButton1.ImageAlign = System.Drawing.ContentAlignment.MiddleLeft;
this.toolStripButton1.Name = "toolStripButton1";
this.toolStripButton1.Text = "&New";
this.toolStripButton1.TextAlign = System.Drawing.ContentAlignment.MiddleRight;
this.toolStripButton1.Click += new System.EventHandler(this.toolStripButton1_Click);
Me.toolStripButton1.Image = Bitmap.FromFile("c:\NewItem.bmp")
Me.toolStripButton1.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.ImageAndText
Me.toolStripButton1.ImageAlign = System.Drawing.ContentAlignment.MiddleLeft
Me.toolStripButton1.Name = "toolStripButton1"
Me.toolStripButton1.Text = "&New"
Me.toolStripButton1.TextAlign = System.Drawing.ContentAlignment.MiddleRight

注釈

プロパティを ImageAlign 使用して、イメージの配置を取得または設定します ToolStripItem。 プロパティを TextAlign 使用して、テキストの配置を取得または設定します ToolStripItem

ImageImageAlignImageIndexImageKeyImageScaling の各プロパティは、画像処理のさまざまな側面に関連します。 コントロールで ToolStrip イメージを使用する場合は、これらのプロパティを直接設定するか、実行時専用 ImageList プロパティを設定します。

画像の拡大縮小は、次のように、ToolStripToolStripItem 両方のプロパティの相互作用によって決定されます。

適用対象

こちらもご覧ください