- UID
- 85167
- 在线时间
- 0 小时
- 最后登录
- 2016-3-16
- 注册时间
- 2012-3-28
- 宅魂
- 507 点
- 贡献
- 220 点
- 宅币
- 4505 枚
- 宅の石(入宅度)
- 0 块
- 元气(技能点)
- 6 点
- 活跃
- 0 ℃
- 听众
- 18
- 收听
- 35
该用户从未签到
序章
- 积分
- 6986
|
发表于 2012-9-25 22:49:27
|
显示全部楼层
List<string> imagenum = new List<string>();
public string 图片(int i)
{
imagenum.Add(@"C:\Users\dell\Desktop\luotianyi\80a46fa98226cffced3c2126b9014a90f703ea76.jpg");
imagenum.Add(@"C:\Users\dell\Desktop\luotianyi\64d6963369ece27ea2cc2ba8.png");
imagenum.Add(@"C:\Users\dell\Desktop\luotianyi\cefc1e178a82b9013d5b7aa9738da9773812efb2.jpg");
imagenum.Add(@"C:\Users\dell\Desktop\luotianyi\yaya.png");
imagenum.Add(@"C:\Users\dell\Desktop\luotianyi\luotianyi.png");
return imagenum;
}
int i = 0;
private void button1_Click(object sender, EventArgs e) //前进按钮
{
i = i >= imagenum.Count-1 ? 0 : i + 1;
pictureBox1.ImageLocation = 图片(i);
}
private void button2_Click(object sender, EventArgs e) //倒退按钮
{
i = i <= 0 ? imagenum.Count : i - 1;
pictureBox1.ImageLocation = 图片(i);
}
参考了二楼的运用了list,终于弄出了前进和返回按钮T.T |
|