diff --git a/Bin/Debug/MyTimeClock/MyTimeClock.exe b/Bin/Debug/MyTimeClock/MyTimeClock.exe index b3c4e18..10a1c0b 100644 Binary files a/Bin/Debug/MyTimeClock/MyTimeClock.exe and b/Bin/Debug/MyTimeClock/MyTimeClock.exe differ diff --git a/Bin/Debug/MyTimeClock/SysDb/Holidays.dat b/Bin/Debug/MyTimeClock/SysDb/Holidays.dat index 62ed53c..56d409d 100644 Binary files a/Bin/Debug/MyTimeClock/SysDb/Holidays.dat and b/Bin/Debug/MyTimeClock/SysDb/Holidays.dat differ diff --git a/Bin/Debug/MyTimeClock/TimeClock.dll b/Bin/Debug/MyTimeClock/TimeClock.dll index 2e411f3..004d1f4 100644 Binary files a/Bin/Debug/MyTimeClock/TimeClock.dll and b/Bin/Debug/MyTimeClock/TimeClock.dll differ diff --git a/Bin/Debug/MyTimeClock/UserDb/TimeTip.dat b/Bin/Debug/MyTimeClock/UserDb/TimeTip.dat index 743caeb..6a08778 100644 Binary files a/Bin/Debug/MyTimeClock/UserDb/TimeTip.dat and b/Bin/Debug/MyTimeClock/UserDb/TimeTip.dat differ diff --git a/Bin/Debug/MyTimeClock/UserDb/Win.dat b/Bin/Debug/MyTimeClock/UserDb/Win.dat index 92b945e..3d557f7 100644 --- a/Bin/Debug/MyTimeClock/UserDb/Win.dat +++ b/Bin/Debug/MyTimeClock/UserDb/Win.dat @@ -1,2 +1,2 @@ [TimeClock] -hwnd=4594100 +hwnd=2563002 diff --git a/Bin/Debug/MyTimeClock/cUpdate.dat b/Bin/Debug/MyTimeClock/cUpdate.dat index 51a59ab..0674bae 100644 --- a/Bin/Debug/MyTimeClock/cUpdate.dat +++ b/Bin/Debug/MyTimeClock/cUpdate.dat @@ -1,3 +1,3 @@ - + \ No newline at end of file diff --git a/CHANGELOG.md b/CHANGELOG.md index d50ff19..3848dbc 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,4 +1,9 @@ -### 2021-10-18更新 +### 2021-12-14更新 +------ +#### TimeClock V1.0.2112.1401 +- *.[改进]针对多显示器进行便笺靠边隐藏功能的改进。 + +### 2021-10-18更新 ------ #### TimeClock V1.0.2110.1801 - *.[新增]便笺窗体圆角显示。 diff --git a/Source/MyTimeClock/.vs/TimeClock/project-colors.json b/Source/MyTimeClock/.vs/TimeClock/project-colors.json new file mode 100644 index 0000000..af47ee9 --- /dev/null +++ b/Source/MyTimeClock/.vs/TimeClock/project-colors.json @@ -0,0 +1,16 @@ +{ + "Version": 1, + "ProjectMap": { + "e546af59-27bb-4699-aa99-a6d7e738cc9d": { + "ProjectGuid": "e546af59-27bb-4699-aa99-a6d7e738cc9d", + "DisplayName": "MyTimeClock", + "ColorIndex": 0 + }, + "62b5c3e8-4af1-4a7f-a40b-a6186f83dbd2": { + "ProjectGuid": "62b5c3e8-4af1-4a7f-a40b-a6186f83dbd2", + "DisplayName": "TimeClock", + "ColorIndex": 1 + } + }, + "NextColorIndex": 2 +} \ No newline at end of file diff --git a/Source/MyTimeClock/.vs/TimeClock/v17/.suo b/Source/MyTimeClock/.vs/TimeClock/v17/.suo index 98a1f2f..13ba14f 100644 Binary files a/Source/MyTimeClock/.vs/TimeClock/v17/.suo and b/Source/MyTimeClock/.vs/TimeClock/v17/.suo differ diff --git a/Source/MyTimeClock/TimeClock/DbOp/FrmSticky.cs b/Source/MyTimeClock/TimeClock/DbOp/FrmSticky.cs index b6ef115..d7292fc 100644 --- a/Source/MyTimeClock/TimeClock/DbOp/FrmSticky.cs +++ b/Source/MyTimeClock/TimeClock/DbOp/FrmSticky.cs @@ -493,8 +493,15 @@ namespace TimeClock.DbOp mStor.SetAttrValue("StickyBackColor", ColorTranslator.ToHtml(StickyBackColor)); mStor.SetAttrValue("Left", this.Left); mStor.SetAttrValue("Top", this.Top); - mStor.SetAttrValue("Width", this.Width); - mStor.SetAttrValue("Height", this. Height); + if (!IsMini) + { + mStor.SetAttrValue("Width", this.Width); + mStor.SetAttrValue("Height", this.Height); + } + else + { + + } mStor.SetAttrValue("TopMost", this.TopMost); mStor.SetAttrValue("Opacity", this.Opacity); mStor.SetAttrValue("PullOverHide", this.靠边隐藏ToolStripMenuItem.Checked); @@ -554,6 +561,8 @@ namespace TimeClock.DbOp mStor.SelectNodeBySet(); this.Location = new Point(mStor.GetAttrValue("Left", 0), mStor.GetAttrValue("Top", 0)); this.Size = new Size(mStor.GetAttrValue("Width", 0), mStor.GetAttrValue("Height", 0)); + if (this.Height < 50) { this.Height = 300; } + if (this.Width < 50) { this.Width = 200; } if (this.Top < 0) { this.Top = 0; } if (this.Left < 0) { this.Left = 0; } var screen = Screen.GetWorkingArea(this); @@ -608,6 +617,14 @@ namespace TimeClock.DbOp dt_change = DateTime.Now; isChange = true; } + private int NormalWidth = 0; + private int NormalHeight = 0; + private bool IsMini = false; + private void SaveSize() + { + NormalWidth = this.Width; + NormalHeight = this.Height; + } [DllImport("User32.dll")] private static extern bool PtInRect(ref Rectangle Rects, Point lpPoint); private void Timer1_Tick(object sender, EventArgs e) @@ -653,24 +670,54 @@ namespace TimeClock.DbOp System.Drawing.Point cursorPoint = new Point(Cursor.Position.X, Cursor.Position.Y);//获取鼠标在屏幕的坐标点 Rectangle Rects = new Rectangle(this.Left, this.Top, this.Left + this.Width, this.Top + this.Height);//存储当前窗体在屏幕的所在区域 bool prInRect = PtInRect(ref Rects, cursorPoint); + var cur_screen = Screen.FromControl(this); if (prInRect) {//当鼠标在当前窗体内 - if (this.Top < 0)//窗体的Top属性小于0 - this.Top = 0; - else if (this.Left < 0)//窗体的Left属性小于0 - this.Left = 0; - else if (this.Right > Screen.PrimaryScreen.WorkingArea.Width)//窗体的Right属性大于屏幕宽度 - this.Left = Screen.PrimaryScreen.WorkingArea.Width - this.Width; + if (IsMini) + { + IsMini = false; + this.Size = new Size(NormalWidth, NormalHeight); + if (this.Top <= 0)//窗体的Top属性小于0 + { + this.Top = 0; + } + else if (this.Left <= 0)//窗体的Left属性小于0 + { + this.Left = 0; + } + else if (this.Right > cur_screen.WorkingArea.Width)//窗体的Right属性大于屏幕宽度 + { + this.Left = cur_screen.WorkingArea.Width - this.Width; + } + } } else { - int space = 8; - if (this.Top < 5) //当窗体的上边框与屏幕的顶端的距离小于5时 - this.Top = 7 - this.Height + space; //将窗体隐藏到屏幕的顶端 - else if (this.Left < 5) //当窗体的左边框与屏幕的左端的距离小于5时 - this.Left = 5 - this.Width + space; //将窗体隐藏到屏幕的左端 - else if (this.Right > Screen.PrimaryScreen.WorkingArea.Width - 5)//当窗体的右边框与屏幕的右端的距离小于5时 - this.Left = Screen.PrimaryScreen.WorkingArea.Width - 5 - space;//将窗体隐藏到屏幕的右端 + //int space = 8; + if (!IsMini) + { + if (this.Top < cur_screen.WorkingArea.Top+ 5) //当窗体的上边框与屏幕的顶端的距离小于5时 + { + SaveSize(); SaveSticky(); IsMini = true; + this.Height = 8; + this.Top = 0; + //this.Top = 7 - this.Height + space; //将窗体隐藏到屏幕的顶端 + } + else if (this.Left < cur_screen.WorkingArea.Left+ 5) //当窗体的左边框与屏幕的左端的距离小于5时 + { + // this.Left = 5 - this.Width + space; //将窗体隐藏到屏幕的左端 + SaveSize(); SaveSticky(); IsMini = true; + this.Width = 8; + this.Left = 0; + } + else if (this.Right > cur_screen.WorkingArea.Right - 5)//当窗体的右边框与屏幕的右端的距离小于5时 + { + //this.Left = cur_screen.WorkingArea.Width - 5 - space;//将窗体隐藏到屏幕的右端 + SaveSize(); SaveSticky(); IsMini = true; + this.Width = 8; + this.Left = cur_screen.WorkingArea.Width- this.Width; + } + } } } } @@ -725,9 +772,12 @@ namespace TimeClock.DbOp protected override void OnSizeChanged(EventArgs e) { base.OnSizeChanged(e); - SetFormRegion(); - if (ControlBox && controlBoxManager != null) - controlBoxManager.FormResize(); + if (!IsMini) + { + SetFormRegion(); + if (ControlBox && controlBoxManager != null) + controlBoxManager.FormResize(); + } } private void FrmSticky_SizeChanged(object sender, EventArgs e) { diff --git a/Source/MyTimeClock/TimeClock/Properties/AssemblyInfo.cs b/Source/MyTimeClock/TimeClock/Properties/AssemblyInfo.cs index 40bfcb4..0964722 100644 --- a/Source/MyTimeClock/TimeClock/Properties/AssemblyInfo.cs +++ b/Source/MyTimeClock/TimeClock/Properties/AssemblyInfo.cs @@ -32,5 +32,5 @@ using System.Runtime.InteropServices; // 可以指定所有值,也可以使用以下所示的 "*" 预置版本号和修订号 // 方法是按如下所示使用“*”: : // [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("1.0.2110.1801")] -[assembly: AssemblyFileVersion("1.0.2110.1801")] \ No newline at end of file +[assembly: AssemblyVersion("1.0.2112.1401")] +[assembly: AssemblyFileVersion("1.0.2112.1401")] \ No newline at end of file