c#中如何实现button控件的背景图片循环切换

2025-03-04 07:32:29
推荐回答(2个)
回答1:

提示你一下,要用到imageList这个控件它有个Iamges属性,用来添加图片定义个全局变量int i = 0;在Button的单击事件中放上这句 this.BackgroundImage=imageList1.Images[++i];

回答2:

先定义一个变量a 。如a=0;在Button的单击事件中a++;Button1.BackgroundImage=imageList1.Images[a];