zoukankan      html  css  js  c++  java
  • 实现鼠标点击以后,内容水平滚动

    using System;
    using System.Collections.Generic;
    using System.ComponentModel;
    using System.Data;
    using System.Drawing;
    using System.Linq;
    using System.Text;
    using System.Windows.Forms;

    namespace gundong_Label
    {
    public partial class Form1 : Form
    {
    public Form1()
    {
    InitializeComponent();
    button2.Enabled = false;
    }

    private void timer1_Tick(object sender, EventArgs e)
    {
    label1.Left -=3; //设置label1左边缘与其容器的工作区左边缘之间的距离
    if (label1.Right < 0) //当label1右边缘与其容器的工作区左边缘之间的距离小于0时
    {
    label1.Left = this.Width; //设置label1左边缘与其容器的工作区左边缘之间的距离为该窗体的宽度
    }
    }
    //开始演示
    private void button1_Click(object sender, EventArgs e)
    {
    timer1.Enabled = true; //开始滚动
    button2.Enabled = true;

    }
    //单击暂停按钮
    private void button2_Click(object sender, EventArgs e)
    {
    timer1.Enabled = false; //停止滚动
    button2.Enabled = false;
    }
    //退出
    private void button3_Click(object sender, EventArgs e)
    {
    this.Close();
    }
    }
    }

  • 相关阅读:
    Day10
    Day9
    Day8
    Day7
    Day 6
    Day5
    第一周计划
    事件总线模式辨析
    解释器模式辨析
    解释器模式深度探究
  • 原文地址:https://www.cnblogs.com/Echo529/p/6382259.html
Copyright © 2011-2022 走看看