private void Form1_Load(object sender
, EventArgs e
)
{
this.BackColor
= Color
.Green
;
this.FormBorderStyle
= FormBorderStyle
.None
;
this.Location
= new Point();
label1
.Text
= "点点啊";
label1
.ForeColor
= Color
.FromArgb(255, 255, 255);
label1
.Font
= new Font("楷体",20);
label1
.Left
= this.Width
/ 2 - label1
.Width
/ 2;
}
private void timer1_Tick(object sender
, EventArgs e
)
{
this.Left
+= 2;
if (this.Left
+this.Width
>=Screen
.PrimaryScreen
.Bounds
.Width
)
{
timer1
.Stop();
timer2
.Enabled
=true;
}
}
private void timer2_Tick(object sender
, EventArgs e
)
{
this.Top
+= 2;
if (this.Top
+ this.Height
>= Screen
.PrimaryScreen
.WorkingArea
.Height
)
{
timer2
.Stop();
timer3
.Enabled
= true;
}
}
private void timer3_Tick(object sender
, EventArgs e
)
{
this.Left
-= 2;
if (this.Left
<= 0)
{
timer3
.Stop();
timer4
.Enabled
= true;
}
}
private void timer4_Tick(object sender
, EventArgs e
)
{
this.Top
-= 2;
if (this.Top
<= 0)
{
timer4
.Enabled
= false;
}
}
转载请注明原文地址: https://mac.8miu.com/read-501412.html