ButtonBase.ImageAlign Özellik

Tanım

Düğme denetimindeki görüntünün hizalamasını alır veya ayarlar.

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

Özellik Değeri

ContentAlignment

Değerlerden ContentAlignment biri. MiddleCenter varsayılan değerdir.

Özel durumlar

Atanan değer değerlerden ContentAlignment biri değil.

Örnekler

Aşağıdaki kod örneği türetilmiş sınıfını Button kullanır ve bazı ortak özelliklerini ayarlar. Sonuç, solda metin ve sağ tarafta resim bulunan düz bir düğme olur. Bu kod, dizininde C:\Graphics depolanan adlı MyBitMap.bmp bir bit eşlem görüntüye sahip olmanız ve ad alanına bir başvuru eklenmesini System.Drawing gerektirir.

private:
   void SetMyButtonProperties()
   {
      // Assign an image to the button.
      button1->Image = Image::FromFile( "C:\\Graphics\\MyBitmap.bmp" );
      // Align the image and text on the button.
      button1->ImageAlign = ContentAlignment::MiddleRight;
      button1->TextAlign = ContentAlignment::MiddleLeft;
      // Give the button a flat appearance.
      button1->FlatStyle = FlatStyle::Flat;
   }
private void SetMyButtonProperties()
 {
    // Assign an image to the button.
    button1.Image = Image.FromFile("C:\\Graphics\\MyBitmap.bmp");
    // Align the image and text on the button.
    button1.ImageAlign = ContentAlignment.MiddleRight;    
    button1.TextAlign = ContentAlignment.MiddleLeft;
    // Give the button a flat appearance.
    button1.FlatStyle = FlatStyle.Flat;
 }
Private Sub SetMyButtonProperties()
    ' Assign an image to the button.
    button1.Image = Image.FromFile("C:\Graphics\MyBitmap.bmp")
    ' Align the image and text on the button.
    button1.ImageAlign = ContentAlignment.MiddleRight
    button1.TextAlign = ContentAlignment.MiddleLeft
    ' Give the button a flat appearance.
    button1.FlatStyle = FlatStyle.Flat
End Sub

Şunlara uygulanır

Ayrıca bkz.