16,554
社区成员
发帖
与我相关
我的任务
分享
Dim st As New Point
Dim st1 As New Point
Dim st2 As New Point
st = Me.Location
st1 = New Point(st.X + 2, st.Y + 2)
st2 = New Point(st.X - 2, st.Y - 2)
Dim i As Integer = 0
While i <= 4
Me.Location = st1
System.Threading.Thread.Sleep(60)
Me.Location = st2
System.Threading.Thread.Sleep(60)
i = i + 1
End While
Me.Location = st
/// <summary>
/// 产生闪屏振动效果
/// </summary>
private void Nudge()
{
if (notifyIcon1.Visible == true)
{
return;
}
if (this.WindowState == FormWindowState.Minimized)
{
this.WindowState = FormWindowState.Normal;
}
int i = 0;
Point _old = this.Location;
Point _new1 = new Point(_old.X + 2, _old.Y + 2);
Point _new2 = new Point(_old.X - 2, _old.Y - 2);
//_sp2.Play();
while (i < 4)
{
this.Location = _new1;
Thread.Sleep(60);
this.Location = _new2;
Thread.Sleep(60);
i++;
}
this.Location = _old;
}