📄 movewordcontrol.cs
字号:
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
using System.Data;
using System.Text;
using System.Windows.Forms;
using System.Threading;
namespace PowerNet.Mobile.Label.ClassLab
{
public partial class MoveWordControl : UserControl
{
private Thread thread ;
public MoveWordControl()
{
InitializeComponent();
this.button1.GotFocus += new EventHandler(MoveGotFocus);
this.button1.LostFocus+=new EventHandler(MoveLostFocus);
}
delegate void TextMoveDelegate(string text);
private void TextMove(string text)
{
this.button1.Text = text;
}
private void TextChange()
{
for (int i = 0; i < 8; i++)
{
TextMoveDelegate move = new TextMoveDelegate(TextMove);
this.Invoke(move, i.ToString());
Thread.Sleep(1000);
}
}
public void StartMoveThread()
{
Thread thread = new Thread(new ThreadStart(TextChange));
thread.Start();
}
private void MoveGotFocus(object sender, EventArgs e)
{
thread = new Thread(new ThreadStart(TextChange));
thread.Start();
}
private void MoveLostFocus(object sender, EventArgs e)
{
thread.Abort();
}
private void button1_Click(object sender, EventArgs e)
{
thread = new Thread(new ThreadStart(TextChange));
thread.Start();
}
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -