共用方式為


ToolStripItem.Image 屬性

定義

取得或設定顯示在 ToolStripItem. 上的影像。

public:
 virtual property System::Drawing::Image ^ Image { System::Drawing::Image ^ get(); void set(System::Drawing::Image ^ value); };
public virtual System.Drawing.Image Image { get; set; }
public virtual System.Drawing.Image? Image { get; set; }
member this.Image : System.Drawing.Image with get, set
Public Overridable Property Image As Image

屬性值

Image將被展示。

範例

以下程式碼範例展示了 ImageToolStripButtonImageAlignDisplayStyleTextAlign性質。 此範例是類別概述中較大範例 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

備註

Image這些 、 ImageAlignImageIndexImageKeyImageScaling 及 屬性涉及影像處理的各個面向。 在控制項中使用圖片 ToolStrip ,可直接設定這些屬性,或設定僅執行 ImageList 時的屬性。

影像縮放由 與 ToolStripItemToolStrip 的性質交互作用決定,具體如下:

適用於