-1

WinFormsボタン87x30サイズのテキストの前に.ico 48x48画像を追加しようとしています:

  button1.BackgroundImageLayout = ImageLayout.Stretch;  
  button1.BackgroundImageLayout = ImageLayout.None;                 
  button1.BackgroundImageLayout = ImageLayout.Zoom;  
  button1.ImageAlign = ContentAlignment.MiddleLeft;
  button1.TextImageRelation = TextImageRelation.ImageBeforeText;
  button1.TextAlign = ContentAlignment.MiddleRight;

結果は次のとおりです。

ここに画像の説明を入力

次のように、左側の画像を関連する距離のテキストに揃える方法を理解しようとしています。

ここに画像の説明を入力

編集:

    button1.TextImageRelation = TextImageRelation.ImageBeforeText;
    button1.TextAlign = ContentAlignment.MiddleLeft; /// MiddleRight; // MiddleCenter; 
    button1.ImageAlign = ContentAlignment.MiddleRight; /// MiddleLeft;

結果:

ここに画像の説明を入力

ここに画像の説明を入力

4

1 に答える 1