码迷,mamicode.com
首页 > 其他好文 > 详细

产品滚动展示

时间:2019-01-15 23:30:14      阅读:168      评论:0      收藏:0      [点我收藏+]

标签:alt   知识   nta   计时器组件   class   false   rgs   src   sha   

实现效果:

  技术分享图片

知识运用:

  Timer计时器组件   Panel容器控件

实现代码:

        private void timer1_Tick(object sender, EventArgs e)
        {
            left = 10;
            this.panel1.Left += left;
            if (this.panel1.Left > this.Width)
            {
                timer1.Enabled = false;
                this.pictureBox1.Image=imageList1.Images[0];
                this.pictureBox2.Image = imageList2.Images[0];
                this.pictureBox3.Image = imageList3.Images[0];
                timer2.Enabled = true;
            }
        }

        private void Form1_Load(object sender, EventArgs e)
        {
            this.pictureBox1.Image = imageList1.Images[0];
            this.pictureBox2.Image = imageList2.Images[0];
            this.pictureBox3.Image = imageList3.Images[0];
        }

        private void timer2_Tick(object sender, EventArgs e)
        {
            left = -10;
            this.panel1.Left += left;
            if(this.panel1.Left<0)
            {
                timer2.Enabled = false;
                this.pictureBox1.Image = imageList1.Images[1];
                this.pictureBox2.Image = imageList2.Images[1];
                this.pictureBox3.Image = imageList3.Images[1];
                timer1.Enabled = true;
            }
        }

  

产品滚动展示

标签:alt   知识   nta   计时器组件   class   false   rgs   src   sha   

原文地址:https://www.cnblogs.com/feiyucha/p/10274756.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!