我正在尝试在 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;
结果: