首页 > 其他 > 详细

产品滚动展示

时间:2019-01-15 23:13:36      阅读:146      评论:0      收藏:0      [点我收藏+]

实现效果:

  技术分享图片

知识运用:

  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;
            }
        }

  

产品滚动展示

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

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!