日期:2014-05-17 浏览次数:20888 次
this.WindowState=FormWindowState.Normal)没效果,,还是显示在屏幕的左上角。。
//窗体隐藏效果
int form_MODE = 0,
form_T = 3,
form_XY = 6;
private void form_hide_Tick(object sender, EventArgs e)
{
if (MouseButtons == MouseButtons.Left)
return;
int x = MousePosition.X, y = MousePosition.Y;
if (x > (this.Location.X - form_XY)
&&
x < (this.Location.X + this.Width + form_XY)
&&
y > (this.Location.Y - form_XY)
&&
y < (this.Location.Y + this.Height + form_XY))
{
if (this.form_MODE == 1)
this.Location = new Point(form_T, this.Location.Y);
else if (this.form_MODE == 2)
this.Location = new Point(Screen.PrimaryScreen.WorkingArea.Width - this.Width - form_T, this.Location.Y);
else if (this.form_MODE == 3)
this.Location = new Point(this.Location.X, form_T);
}
else//鼠标移动到窗口外,隐藏
{
if (this.Location.Y <= form_T)//上
&n