private void AdapterForm_Load(object sender, EventArgs e) { try { rectangle_Screen = SystemInformation.WorkingArea; //rectangle_Screen = Screen.GetWorkingArea(this); //程序启动后,窗体在屏幕右侧中部 this.Left = SystemInformation.PrimaryMonitorMaximizedWindowSize.Width; this.Top = (SystemInformation.PrimaryMonitorMaximizedWindowSize.Height - this.Height) / 2; form_Navigation = new NavigationForm(); form_Calendar = new CalendarForm(); form_Navigation.Owner = this; form_Calendar.Owner = this; PhysicalMemoryTimer_Tick(null, null); System.Windows.Forms.Timer PhysicalMemoryTimer = new System.Windows.Forms.Timer(); PhysicalMemoryTimer.Tick += new EventHandler(PhysicalMemoryTimer_Tick); PhysicalMemoryTimer.Interval = 3000; PhysicalMemoryTimer.Enabled = true; System.Windows.Forms.Timer StopRectTimer = new System.Windows.Forms.Timer(); StopRectTimer.Tick += new EventHandler(StopRectTimer_Tick); StopRectTimer.Interval = 1000; StopRectTimer.Enabled = true; this.RegisterAppBar(false); updateTimer = new System.Windows.Forms.Timer(); updateTimer.Tick += new EventHandler(CheckNewVersion_Tick); updateTimer.Interval = 10 * 1000; updateTimer.Enabled = true; } catch { } }
private void Init() { try { UpdateAndwhoData(); screenRect = System.Windows.Forms.Screen.PrimaryScreen.WorkingArea; //程序启动后,窗体在屏幕右侧中部 this.Left = screenRect.Right-this.Width; this.Top = (screenRect.Bottom - this.Height) / 2; navigationForm = new NavigationForm(); calendarForm = new CalendarForm(); PhysicalMemoryTimer_Tick(null, null); System.Windows.Forms.Timer PhysicalMemoryTimer = new System.Windows.Forms.Timer(); PhysicalMemoryTimer.Tick += new EventHandler(PhysicalMemoryTimer_Tick); PhysicalMemoryTimer.Interval = 3000;//时间 PhysicalMemoryTimer.Enabled = true; System.Windows.Forms.Timer StopRectTimer = new System.Windows.Forms.Timer(); StopRectTimer.Tick += new EventHandler(StopRectTimer_Tick); StopRectTimer.Interval = 1000;//时间 StopRectTimer.Enabled = true; CheckNewVersion(); } catch { } }