基本信息
源码名称:winform 多图滚动显示的产品展示效果 附完整源码
源码大小:0.22M
文件格式:.zip
开发语言:C#
更新时间:2013-04-24
友情提示:(无需注册或充值,赞助后即可获取资源下载链接)
嘿,亲!知识可是无价之宝呢,但咱这精心整理的资料也耗费了不少心血呀。小小地破费一下,绝对物超所值哦!如有下载和支付问题,请联系我们QQ(微信同号):78630559
本次赞助数额为: 2 元×
微信扫码支付:2 元
×
请留下您的邮箱,我们将在2小时内将文件发到您的邮箱
源码介绍
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using System.IO;
namespace ProductTumblingShown
{
public partial class Frm_Main : Form
{
int left = 0;
public Frm_Main()
{
InitializeComponent();
}
private void timer1_Tick(object sender, EventArgs e)
{
left = 10; //初始化变量left的值
this.panel1.Left = left; //设置panel1控件距容器左边缘之间的距离
int width = this.Width - this.panel1.Width; //初始化变量width
if (this.panel1.Left > width) //当panel1控件距容器左边缘之间的距离大于width时
{
this.timer1.Enabled = false; //禁用计时器timer1
this.timer2.Enabled = true; //启用计时器timer2
this.pictureBox1.Image = this.imageList1.Images[0];//设置pictureBox1控件中显示的图片
this.pictureBox2.Image = this.imageList2.Images[0];//设置pictureBox2控件中显示的图片
this.pictureBox3.Image = this.imageList3.Images[0];//设置pictureBox3控件中显示的图片
}
}
private void Frm_Main_Load(object sender, EventArgs e)
{
this.pictureBox1.Image = this.imageList1.Images[0]; //设置pictureBox1控件中显示的图片
this.pictureBox2.Image = this.imageList2.Images[0]; //设置pictureBox2控件中显示的图片
this.pictureBox3.Image = this.imageList3.Images[0]; //设置pictureBox3控件中显示的图片
}
private void timer2_Tick(object sender, EventArgs e)
{
left = -10; //初始化left的值
this.panel1.Left = left; //设置panel1距容器左边缘之间的距离
if (this.panel1.Left < 0) //当panel1距容器左边缘之间的距离小于0时
{
this.timer1.Enabled = true; //启用计时器timer1
this.timer2.Enabled = false; //禁用计时器timer2
this.pictureBox1.Image = this.imageList1.Images[1]; //设置pictureBox1控件中显示的图片
this.pictureBox2.Image = this.imageList2.Images[1]; //设置pictureBox2控件中显示的图片
this.pictureBox3.Image = this.imageList3.Images[1]; //设置pictureBox3控件中显示的图片
}
}
}
}