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

  • 相关阅读:
    css换行
    VC include 路径解析 冷夜
    DirectxDraw学习笔记 冷夜
    winmain窗口代码 冷夜
    DirectDraw 常用功能代码记录 冷夜
    C/C++ 内存分配方式,堆区,栈区,new/delete/malloc/free 冷夜
    BMP文件结构 冷夜
    管道流
    打印流
    字符编码
  • 原文地址:https://www.cnblogs.com/Echo529/p/6382259.html
Copyright © 2011-2022 走看看