private void 顶部ToolStripMenuItem_Click(object sender, EventArgs e) { if (this.frmDispLocation != frmDispLoc.top) { if (this.frmDispLocation != frmDispLoc.buttom ) ChangeDisHorizontal(); int i = Screen.PrimaryScreen.WorkingArea.Width; this.Location = new Point(i/2-this.Width /2,0); this.frmDispLocation = frmDispLoc.top; } }
private void frmTop_Load(object sender, EventArgs e) { frmDispLocation = frmDispLoc.top; PPicBoxLoction =new Point ( PpicboxInitLocation.X ,PpicboxInitLocation .Y +10); TxtKey(false); this.Size = pFrmSize; //Region rg= new Region (this.TranPicbox((Bitmap) this.BackgroundImage)); //this.Region = rg; LoadEvent(); try { ////控制键盘 HookKey h = new HookKey(); prc = new HookKey.HOOKPROC(H); h.InstallHookKey(prc); } catch { } //显示数据 wd.path = xmlPath + "\\file.xml"; if (System.IO.File.Exists(xmlPath + "\\file.xml")) { DataSet ds = new DataSet(); ds.ReadXml(xmlPath + "\\file.xml"); if (ds.Tables.Count >= 1) { foreach (DataTable dt in ds.Tables) { if ("appliction" == dt.TableName) { foreach (DataRow dr in dt.Rows) { AddPictureBox(dr); } } else if ("clock" == dt.TableName) { foreach (DataRow dr in dt.Rows) { if(null != dr[2]) time = dr[2].ToString(); string week = DateTime.Now.DayOfWeek.ToString (); if (-1 < dr["week"].ToString().IndexOf(week)) { isshutdown = true; time = dr["time"].ToString(); this.timGJ.Enabled = true; } else { isshutdown = false; this.timGJ.Enabled = false; } } } } } } else { wd.CreateFile(); } pFrmLoction=new Point((Screen .GetWorkingArea(this).Width-this.Width )/2 ,this.Location .Y ); this.Location =pFrmLoction ; this.timFrm.Enabled = true; }
private void 左边ToolStripMenuItem_Click(object sender, EventArgs e) { if (frmDispLocation != frmDispLoc.left) { if( frmDispLocation != frmDispLoc.right) ChangeDisVertical(); int i = Screen.PrimaryScreen.WorkingArea.Height; this.Location = new Point(0, i / 2 - this.Height / 2); this.frmDispLocation = frmDispLoc.left; } }