单击按钮时是否可以更改按钮的背景图像?我在Windows Forms Application上使用C#。
答案 0 :(得分:2)
是的,这是可能的。只需在其点击事件上设置按钮的BackgroundImage
属性即可。
答案 1 :(得分:0)
试试这个,
button1.BackgroundImage = Image.FromFile("ImageFilepath");
button1.BackgroundImageLayout = ImageLayout.Stretch;
答案 2 :(得分:-1)
background-size 属性对您有用,即 background-size:封面或背景尺寸:100%