C#中如何设置图片交替显示

[复制链接]
查看11 | 回复2 | 2013-4-23 16:51:13 | 显示全部楼层 |阅读模式
加定时器,把所有的图片存的ImageList中,声明一个整型的成员变量index然后在定时器事件中更改图片 控件名.Image=ImageList名称.Image[index++%tImageList名称.Images.Count]...
回复

使用道具 举报

千问 | 2013-4-23 16:51:13 | 显示全部楼层
int i = 0;//设置图片的初始下标为0
private void timeChange_Tick(object sender, EventArgs e)
{
this.picBox.Image = imageList.Images[i++];//切换图片
...
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

主题

0

回帖

4882万

积分

论坛元老

Rank: 8Rank: 8

积分
48824836
热门排行