【WinForm】控件动态添加图片
以下方法适用于大部分控件。
一、使用Properties.Resources类
需要你事先将图片添加到项目中。添加方法如下:
button.BackgroundImage = 命名空间名.Properties.Resources.图片名称;
二、使用图片链接
button.BackgroundImage =Bitmap.FromFile("d:\\123.png");
/*******相与枕藉乎舟中,不知东方之既白*******/