C#中用timer制作广告显示屏

来源:百度知道 编辑:UC知道 时间:2024/06/12 05:20:34
字幕要可以移动

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

namespace TimerMove
{
public partial class Form1 : Form
{
Point Start = new Point();
public Form1()
{
InitializeComponent();
}

private void Form1_Load(object sender, EventArgs e)
{
Start = this.label1.Location;
this.timer1.Start();
}

private void timer1_Tick(object sender, EventArgs e)
{
Point po = new Point(this.label1.Left, this.label1.Right);
if (po.X > 0)
{
this.label1.Left = po.X - 5;
}
else
{
this.label1.Location = Start;