Zi 字媒體
2017-07-25T20:27:27+00:00
C# button 按鈕+Image圖片 顯示設定
資料來源:https://msdn.microsoft.com/zh-tw/library/system.windows.forms.buttonbase.image(v=vs.110).aspx
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;
}
寫了
5860316篇文章,獲得
23313次喜歡