private void timer2_Tick(object sender, EventArgs e)
{
if (UserHelp.personalInfoFormOpen == false)
{
getuser(UserHelp.loginId);
pictureBox1.Image = imageList1.Images[Convert.ToInt32(UserHelp.faceId)];
label1.Text = UserHelp.userNickName;
}
#region çªä½ç§»å¨å°å±å¹ä¸¤è¾¹åççåå
Rectangle ScreenArea = System.Windows.Forms.Screen.GetWorkingArea(this); //è·åå±å¹é«ï¼å®½
int h=this.Height; //è·åçªä½çé«åº¦
if (this.Left < -126)
{
this.Top = 1;
this.Left = 0;
this.Height = ScreenArea.Height; //å±å¹ é«
}
if (this.Left >= ScreenArea.Width - 126)
{
this.Top = 1;
this.Left = ScreenArea.Width - 252;
this.Height = ScreenArea.Height;
}
if (this.Left > 0 && this.Left < ScreenArea.Width - 252)
{
this.Height = 551;
}
if (this.Top<=0)
{
this.Top = h - 2*h+5;
}
#endregion
} private void MainForm_MouseHover(object sender, EventArgs e)
{
if (this.Top < -100)
{
this.Top = 1;
}
}
温馨提示:内容为网友见解,仅供参考