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 값 중 하나입니다. 기본값은 MiddleLeft입니다.

예외

할당된 값이 ContentAlignment 값 중 하나가 아닌 경우

예제

다음 코드 예제에서는 에 대 한 Image, ImageAlignDisplayStyleTextAlign 속성을 보여 줍니다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사용하여 .

합니다 Image, ImageAlignImageIndex, ImageKey, 및 ImageScaling 다양 한 이미지 처리와 관련 된 속성입니다. 이러한 속성을 직접 설정하거나 런타임 전용 ImageList 속성을 설정하여 컨트롤에서 이미지를 ToolStrip 사용합니다.

둘 다에서 속성의 상호 작용에 의해 결정 됩니다 이미지 크기 조정 ToolStripToolStripItem다음과 같이 합니다.

적용 대상

추가 정보