Exemplo n.º 1
0
 // 在鼠标旁边上方显示历史记录窗口
 public static void ShowHistory(double x, double y)
 {
     if (MyVariable.Variable.HistoryLoaded == true)
     {
         foreach (Window window in Application.Current.Windows)
         {
             if (window.Title is "history")
             {
                 window.ShowInTaskbar = false;
                 window.Activate();
                 window.Topmost = true;
             }
         }
     }
     else
     {
         Window historyWindow = new history
         {
             WindowStartupLocation = WindowStartupLocation.Manual
         };
         historyWindow.Left          = x - historyWindow.Width;
         historyWindow.Top           = y - historyWindow.Height;
         historyWindow.ShowInTaskbar = false;
         historyWindow.Show();
         historyWindow.Topmost = true;
         MyVariable.Variable.TempLoadedHistory = true;
     }
 }
Exemplo n.º 2
0
        //在屏幕中间显示历史记录窗口
        public static void ShowHistoryCenter()
        {
            if (MyVariable.Variable.HistoryLoaded == true)
            {
                foreach (Window window in Application.Current.Windows)
                {
                    if (window.Title is "history")
                    {
                        window.ShowInTaskbar = true;
                        window.Activate();
                    }
                }
            }
            else
            {
                Window historyWindow = new history();

                historyWindow.WindowStartupLocation = WindowStartupLocation.CenterScreen;
                historyWindow.ShowInTaskbar         = true;
                historyWindow.Show();

                //MyVariable.Variable.HistoryLoaded = true;
            }
        }