/// <summary> /// 动态隐藏方法 /// </summary> /// <param name="hideTo">隐藏后的动作</param> private void HideMe(HideTo hideTo) { UnityModule.DebugPrint("开始动态隐藏窗体...{0}", this.Name); ThreadPool.QueueUserWorkItem(new WaitCallback(delegate { int IniTop = this.Top; while (this.Opacity > 0) { this.Opacity -= 0.1; this.Top -= 2; Thread.Sleep(15); } if (hideTo == HideTo.Min) { UnityModule.DebugPrint("最小化窗体"); this.WindowState = FormWindowState.Minimized; this.Opacity = 1.0; this.Top = IniTop; } else if (hideTo == HideTo.JustHide) { this.Hide(); this.Opacity = 1.0; this.Top = IniTop; SignInButton.Text = "Sign In"; } else if (hideTo == HideTo.Close) { UnityModule.DebugPrint("退出程序"); AllowToClose = true; Application.Exit(); } })); }
/// <summary> /// 动态隐藏方法 /// </summary> /// <param name="hideTo">隐藏后的动作</param> private void HideMe(HideTo hideTo) { UnityModule.DebugPrint("开始动态隐藏窗体...{0}", this.Name); ThreadPool.QueueUserWorkItem(new WaitCallback(delegate { int IniTop = this.Top; while (this.Opacity > 0) { this.Opacity -= 0.1; this.Top -= 2; Thread.Sleep(15); } if (hideTo == HideTo.Min) { UnityModule.DebugPrint("最小化窗体"); this.WindowState = FormWindowState.Minimized; this.Opacity = 1.0; this.Top = IniTop; } else if (hideTo == HideTo.JusetClose) { UnityModule.DebugPrint("关闭ClientForm"); //初始化FriendItem静态数据,否则再次登录后会出现问题 FriendItem.ResetStaticData(); AllowToClose = true; this.Close(); } else if (hideTo == HideTo.ExitApp) { UnityModule.DebugPrint("退出程序"); AllowToClose = true; ExitApplication(); } })); }