1个回答
展开全部
private void button1_Click(object sender, EventArgs e)
{
Timer t = new Timer();
t.Interval = 50;
int n = 0;
int w = this.label1.Width;
t.Tick += (s, ee) =>
{
n += 10;
int d = this.Width - w;
this.label1.Left = n % d;
};
t.Start();
}
追问
是vb.net
追答
Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
Dim t As New Timer
t.Interval = 50
AddHandler t.Tick, AddressOf T_Tick
t.Start()
End Sub
Dim n = 0
Private Sub T_Tick(sender As Object, e As EventArgs)
Dim w = Me.Label1.Width
n += 10
Dim d = Me.Width - w
Me.Label1.Left = n Mod d
End Sub
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询