### 2021-06-13更新

------
#### ryControls    V2.1.2106.1301
- *.[改进]点击窗口标题栏最大化时, 不覆盖桌面任务栏。
This commit is contained in:
紫林软件 2021-06-15 09:41:34 +08:00
parent a3f978b187
commit 870234f406
23 changed files with 356 additions and 318 deletions

View File

@ -1,2 +1,2 @@
[Money_Op]
hwnd=1118096
hwnd=263848

View File

@ -1,4 +1,4 @@
<root>
<list id="LastUpdateTime" Value="2021/6/12 16:48:22" />
<list id="LastUpdateTime" Value="2021/6/13 23:15:28" />
<list id="UpdateAfterTime" Value="0" />
</root>

View File

@ -1,4 +1,10 @@
### 2021-06-12更新
### 2021-06-13更新
------
#### ryControls V2.1.2106.1301
- *.[改进]点击窗口标题栏最大化时, 不覆盖桌面任务栏。
### 2021-06-12更新
------
#### Itrycn_Project2 V1.0.2106.1201
- *.[新增]新增加入皮肤功能。

View File

@ -1,26 +1,26 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace Itrycn_Project
{
/// <summary>
/// 配置类,保存在文件中的配置信息(本系统基于乘黄V2架构)
/// </summary>
public static class Public_Config
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace Itrycn_Project
{
/// <summary>
/// 配置类,保存在文件中的配置信息(本系统基于乘黄V2架构)
/// </summary>
public static class Public_Config
{
/// <summary>
/// 在点击主窗口关闭按钮时,隐藏窗体(只有开启了托盘图标,本功能才能生效,此时需要通过托盘图标进行关闭)。
/// </summary>
public static bool HideByCloseBtn = false;
public static void LoadSetting()
{
ryCommon.Storage Stor = new ryCommon.Storage();
Stor.LoadFromFile(Soft_ConstInfo.UserDataFolder+"\\Setting.dat");
Stor.SelectNodeBySet();
HideByCloseBtn = Stor.GetAttrValue("HideByCloseBtn", false);
//low_count = Stor.GetAttrValue("LowCount", 10);
}
}
}
/// <summary>
/// 在点击主窗口关闭按钮时,隐藏窗体(只有开启了托盘图标,本功能才能生效,此时需要通过托盘图标进行关闭)。
/// </summary>
public static bool HideByCloseBtn = false;
public static void LoadSetting()
{
ryCommon.Storage Stor = new ryCommon.Storage();
Stor.LoadFromFile(Soft_ConstInfo.UserDataFolder+"\\Setting.dat");
Stor.SelectNodeBySet();
HideByCloseBtn = Stor.GetAttrValue("HideByCloseBtn", false);
//low_count = Stor.GetAttrValue("LowCount", 10);
}
}
}

View File

@ -1,74 +1,74 @@
using ryCommon;
using ryCommonDb;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows.Forms;
namespace Itrycn_Project
{
using ryCommon;
using ryCommonDb;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows.Forms;
namespace Itrycn_Project
{
/// <summary>
/// 运行期间存储的变量,不会存储在文件中,只存储内存中.每次启动软件会初始化变量。
/// </summary>
/// </summary>
public static class Soft_MemInfo
{
/// <summary>
/// 是否能关闭窗体。
/// 设置本值为false,可以阻止窗口被手动关闭。
/// </summary>
/// <summary>
/// 是否能关闭窗体。
/// 设置本值为false,可以阻止窗口被手动关闭。
/// </summary>
public static bool IsCanCloseForm { get; set; } = true;
}
/// <summary>
/// 配置类,保存在运行期间不会被改变的配置信息(本系统基于乘黄V2架构)
/// 在运行期间请勿改动本类中的变量值。
/// </summary>
public static class Soft_ConstInfo
{
/// <summary>
/// 在线升级配置文件的url
/// </summary>
public const string Update_Url = "http://www.itrycn.com/update/ryWebMon4.xml";
/// <summary>
/// 软件标题
/// </summary>
public const string Soft_Title = "睿元管理系统";
/// <summary>
/// 软件ID
/// </summary>
public const string Soft_Id = "Money_Op";
/// <summary>
/// 开机启动的参数
/// </summary>
public const string Soft_Pram = "q";
/// <summary>
/// 官网地址
/// </summary>
public const string Soft_Url = "http://www.itrycn.com";
/// <summary>
/// 售后QQ群
/// </summary>
public const string QQ_Qun = "183161992";
/// <summary>
/// 关于界面内容.支持以下变量
/// #softname#:软件名称
/// #ver#:版本号
/// </summary>
public const string AboutText = "#softname# #ver#";
/// <summary>
/// 用户文件夹,该相对路径设置,将在程序启动后转换
/// </summary>
public static string UserDataFolder = @"<app>\UserDb";
/// <summary>
/// 自带配置文件夹,该相对路径设置,将在程序启动后转换
/// </summary>
public static string SysDataFolder = @"<app>\SysDb";
/// <summary>
/// 是否允许显示托盘图标
/// </summary>
public const bool ShowTray = false;
/// <summary>
/// 是否显示捐赠方式
/// </summary>
public static bool DonateVisabled = false;
}
}
}
/// <summary>
/// 配置类,保存在运行期间不会被改变的配置信息(本系统基于乘黄V2架构)
/// 在运行期间请勿改动本类中的变量值。
/// </summary>
public static class Soft_ConstInfo
{
/// <summary>
/// 在线升级配置文件的url
/// </summary>
public const string Update_Url = "http://www.itrycn.com/update/ryWebMon4.xml";
/// <summary>
/// 软件标题
/// </summary>
public const string Soft_Title = "睿元管理系统";
/// <summary>
/// 软件ID
/// </summary>
public const string Soft_Id = "Money_Op";
/// <summary>
/// 开机启动的参数
/// </summary>
public const string Soft_Pram = "q";
/// <summary>
/// 官网地址
/// </summary>
public const string Soft_Url = "http://www.itrycn.com";
/// <summary>
/// 售后QQ群
/// </summary>
public const string QQ_Qun = "183161992";
/// <summary>
/// 关于界面内容.支持以下变量
/// <para>#softname#:软件名称</para>
/// <para>#ver#:版本号</para>
/// </summary>
public const string AboutText = "#softname# #ver#";
/// <summary>
/// 用户文件夹,该相对路径设置,将在程序启动后转换
/// </summary>
public static string UserDataFolder = @"<app>\UserDb";
/// <summary>
/// 自带配置文件夹,该相对路径设置,将在程序启动后转换
/// </summary>
public static string SysDataFolder = @"<app>\SysDb";
/// <summary>
/// 是否允许显示托盘图标
/// </summary>
public const bool ShowTray = false;
/// <summary>
/// 是否显示捐赠方式
/// </summary>
public static bool DonateVisabled = true;
}
}

View File

@ -53,7 +53,7 @@
this.pnlTopLogo.Dock = System.Windows.Forms.DockStyle.Top;
this.pnlTopLogo.Location = new System.Drawing.Point(1, 27);
this.pnlTopLogo.Name = "pnlTopLogo";
this.pnlTopLogo.Size = new System.Drawing.Size(507, 59);
this.pnlTopLogo.Size = new System.Drawing.Size(523, 59);
this.pnlTopLogo.TabIndex = 8;
//
// lblTitle
@ -71,7 +71,7 @@
//
this.label1.AutoSize = true;
this.label1.BackColor = System.Drawing.Color.Transparent;
this.label1.Location = new System.Drawing.Point(12, 67);
this.label1.Location = new System.Drawing.Point(13, 99);
this.label1.Name = "label1";
this.label1.Size = new System.Drawing.Size(35, 12);
this.label1.TabIndex = 9;
@ -92,7 +92,7 @@
this.lblVisitUrl.Cursor = System.Windows.Forms.Cursors.Hand;
this.lblVisitUrl.Font = new System.Drawing.Font("宋体", 9F, System.Drawing.FontStyle.Underline, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.lblVisitUrl.ForeColor = System.Drawing.Color.Blue;
this.lblVisitUrl.Location = new System.Drawing.Point(53, 67);
this.lblVisitUrl.Location = new System.Drawing.Point(54, 99);
this.lblVisitUrl.Name = "lblVisitUrl";
this.lblVisitUrl.Size = new System.Drawing.Size(77, 12);
this.lblVisitUrl.TabIndex = 11;
@ -106,7 +106,7 @@
this.LblQQ_Qun.Cursor = System.Windows.Forms.Cursors.Hand;
this.LblQQ_Qun.Font = new System.Drawing.Font("宋体", 9F, System.Drawing.FontStyle.Underline, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.LblQQ_Qun.ForeColor = System.Drawing.Color.Blue;
this.LblQQ_Qun.Location = new System.Drawing.Point(234, 67);
this.LblQQ_Qun.Location = new System.Drawing.Point(235, 99);
this.LblQQ_Qun.Name = "LblQQ_Qun";
this.LblQQ_Qun.Size = new System.Drawing.Size(59, 12);
this.LblQQ_Qun.TabIndex = 14;
@ -126,7 +126,7 @@
//
this.label5.AutoSize = true;
this.label5.BackColor = System.Drawing.Color.Transparent;
this.label5.Location = new System.Drawing.Point(193, 67);
this.label5.Location = new System.Drawing.Point(194, 99);
this.label5.Name = "label5";
this.label5.Size = new System.Drawing.Size(35, 12);
this.label5.TabIndex = 12;
@ -135,7 +135,7 @@
// pictureBox1
//
this.pictureBox1.Image = ((System.Drawing.Image)(resources.GetObject("pictureBox1.Image")));
this.pictureBox1.Location = new System.Drawing.Point(85, 105);
this.pictureBox1.Location = new System.Drawing.Point(85, 145);
this.pictureBox1.Name = "pictureBox1";
this.pictureBox1.Size = new System.Drawing.Size(319, 174);
this.pictureBox1.SizeMode = System.Windows.Forms.PictureBoxSizeMode.AutoSize;
@ -147,7 +147,7 @@
this.label3.AutoSize = true;
this.label3.BackColor = System.Drawing.Color.Transparent;
this.label3.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(64)))), ((int)(((byte)(64)))), ((int)(((byte)(64)))));
this.label3.Location = new System.Drawing.Point(13, 297);
this.label3.Location = new System.Drawing.Point(13, 337);
this.label3.Name = "label3";
this.label3.Size = new System.Drawing.Size(365, 12);
this.label3.TabIndex = 18;
@ -158,7 +158,7 @@
this.label6.AutoSize = true;
this.label6.BackColor = System.Drawing.Color.Transparent;
this.label6.Font = new System.Drawing.Font("宋体", 9F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.label6.Location = new System.Drawing.Point(100, 90);
this.label6.Location = new System.Drawing.Point(100, 130);
this.label6.Name = "label6";
this.label6.Size = new System.Drawing.Size(285, 12);
this.label6.TabIndex = 19;
@ -169,18 +169,17 @@
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.BackColor = System.Drawing.Color.White;
this.ClientSize = new System.Drawing.Size(509, 336);
this.ClientSize = new System.Drawing.Size(525, 360);
this.Controls.Add(this.label6);
this.Controls.Add(this.label3);
this.Controls.Add(this.pictureBox1);
this.Controls.Add(this.LblQQ_Qun);
this.Controls.Add(this.label4);
this.Controls.Add(this.label5);
this.Controls.Add(this.lblVisitUrl);
this.Controls.Add(this.label2);
this.Controls.Add(this.label1);
this.Controls.Add(this.lblVisitUrl);
this.Controls.Add(this.label3);
this.Controls.Add(this.LblQQ_Qun);
this.Controls.Add(this.pictureBox1);
this.Controls.Add(this.label5);
this.Controls.Add(this.label4);
this.Controls.Add(this.label2);
this.Controls.Add(this.pnlTopLogo);
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedSingle;
this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon")));
this.MaximizeBox = false;
this.Name = "FrmAbout";

View File

@ -41,6 +41,8 @@
this.ToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.chromeTabControl1 = new ryControls.ChromeTabControl();
this.tabPage1 = new System.Windows.Forms.TabPage();
this.ToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.ToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.MenuTray.SuspendLayout();
this.menuStrip1.SuspendLayout();
this.chromeTabControl1.SuspendLayout();
@ -77,6 +79,7 @@
// menuStrip1
//
this.menuStrip1.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
this.ToolStripMenuItem,
this.ToolStripMenuItem});
this.menuStrip1.Location = new System.Drawing.Point(1, 27);
this.menuStrip1.Name = "menuStrip1";
@ -96,14 +99,14 @@
// 打开官网ToolStripMenuItem
//
this.ToolStripMenuItem.Name = "打开官网ToolStripMenuItem";
this.ToolStripMenuItem.Size = new System.Drawing.Size(136, 22);
this.ToolStripMenuItem.Size = new System.Drawing.Size(180, 22);
this.ToolStripMenuItem.Text = "打开官网";
this.ToolStripMenuItem.Click += new System.EventHandler(this.ToolStripMenuItem_Click);
//
// 捐助ToolStripMenuItem
//
this.ToolStripMenuItem.Name = "捐助ToolStripMenuItem";
this.ToolStripMenuItem.Size = new System.Drawing.Size(136, 22);
this.ToolStripMenuItem.Size = new System.Drawing.Size(180, 22);
this.ToolStripMenuItem.Text = "关于和捐助";
this.ToolStripMenuItem.Click += new System.EventHandler(this.ToolStripMenuItem_Click);
//
@ -138,6 +141,21 @@
this.tabPage1.Text = "首页";
this.tabPage1.UseVisualStyleBackColor = true;
//
// 工具ToolStripMenuItem
//
this.ToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
this.ToolStripMenuItem});
this.ToolStripMenuItem.Name = "工具ToolStripMenuItem";
this.ToolStripMenuItem.Size = new System.Drawing.Size(44, 21);
this.ToolStripMenuItem.Text = "工具";
//
// 选项ToolStripMenuItem
//
this.ToolStripMenuItem.Name = "选项ToolStripMenuItem";
this.ToolStripMenuItem.Size = new System.Drawing.Size(180, 22);
this.ToolStripMenuItem.Text = "选项";
this.ToolStripMenuItem.Click += new System.EventHandler(this.ToolStripMenuItem_Click);
//
// FrmStart
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F);
@ -172,5 +190,7 @@
private System.Windows.Forms.ToolStripMenuItem ToolStripMenuItem;
private System.Windows.Forms.ToolStripMenuItem ToolStripMenuItem;
private System.Windows.Forms.ToolStripMenuItem ToolStripMenuItem;
private System.Windows.Forms.ToolStripMenuItem ToolStripMenuItem;
private System.Windows.Forms.ToolStripMenuItem ToolStripMenuItem;
}
}

View File

@ -129,6 +129,7 @@ namespace Itrycn_Project2
private void FrmStart_Load(object sender, EventArgs e)
{
Public_Config.LoadSetting();
RyFiles.AddDropDrag(tabPage1.Handle);
//Itrycn_Project.Itrycn_Db.CreateTable();
//var dbver = Itrycn_Db.GetDbVer();
@ -150,5 +151,15 @@ namespace Itrycn_Project2
LiveUpdate.RyUpdate update = new LiveUpdate.RyUpdate(Soft_ConstInfo.Update_Url);
update.CheckUpdate();
}
private void ToolStripMenuItem_Click(object sender, EventArgs e)
{
FrmSetting frm = new FrmSetting();
if(frm.ShowDialog()==DialogResult.OK)
{
Public_Config.LoadSetting();
}
frm.Dispose();
}
}
}

View File

@ -22,8 +22,8 @@ namespace Itrycn_Project
AppDomain.CurrentDomain.UnhandledException += CurrentDomain_UnhandledException;
Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(false);
Soft_ConstInfo.UserDataFolder = ryCommon.RyFiles.GetRealPath(Soft_ConstInfo.UserDataFolder);
Soft_ConstInfo.SysDataFolder = ryCommon.RyFiles.GetRealPath(Soft_ConstInfo.SysDataFolder);
Soft_ConstInfo.UserDataFolder = ryCommon.RyFiles.GetRealPath(Soft_ConstInfo.UserDataFolder);
run = new System.Threading.Mutex(true, Soft_ConstInfo.Soft_Id, out bool runone);
if (!runone) //已经运行了
{

View File

@ -32,5 +32,5 @@ using System.Runtime.InteropServices;
// 可以指定所有值,也可以使用以下所示的 "*" 预置版本号和修订号
// 方法是按如下所示使用“*”: :
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.2106.1201")]
[assembly: AssemblyFileVersion("1.0.2106.1201")]
[assembly: AssemblyVersion("1.0.2106.1301")]
[assembly: AssemblyFileVersion("1.0.2106.1301")]

View File

@ -1,199 +1,201 @@
using System;
using System.Drawing;
using System.Drawing.Drawing2D;
using System.Windows.Forms;
using MGdu.WinFormUI.MyGraphics;
//忽略没有注释警告
#pragma warning disable 1591
namespace MGdu.WinFormUI
{
public class ControlBoxManager
{
private GMForm _owner;
private WLButton closeBtn;
private WLButton maxBtn;
private WLButton resBtn;
private WLButton minBtn;
#region event handler
private void CloseBtnClick(object sender, EventArgs e)
{
_owner.Close();
}
private void MaxBtnClick(object sender, EventArgs e)
using System;
using System.Drawing;
using System.Drawing.Drawing2D;
using System.Windows.Forms;
using MGdu.WinFormUI.MyGraphics;
//忽略没有注释警告
#pragma warning disable 1591
namespace MGdu.WinFormUI
{
public class ControlBoxManager
{
private GMForm _owner;
private WLButton closeBtn;
private WLButton maxBtn;
private WLButton resBtn;
private WLButton minBtn;
#region event handler
private void CloseBtnClick(object sender, EventArgs e)
{
_owner.Close();
}
private void MaxBtnClick(object sender, EventArgs e)
{
var MaximumSize = _owner.MaximumSize;
var curScreen = Screen.FromControl(_owner);
_owner.MaximumSize = new Size(curScreen.WorkingArea.Width, curScreen.WorkingArea.Height);
_owner.WindowState = FormWindowState.Maximized;
_owner.MaximumSize = MaximumSize;
}
private void ResBtnClick(object sender, EventArgs e)
{
_owner.WindowState = FormWindowState.Normal;
}
private void MinBtnClick(object sender, EventArgs e)
{
_owner.WindowState = FormWindowState.Minimized;
}
#endregion
private void SetControlBoxColor()
{
closeBtn.ColorTable = _owner.XTheme.CloseBoxColor;
closeBtn.BackImageNormal = _owner.XTheme.CloseBoxBackImageNormal;
closeBtn.BackImageHover = _owner.XTheme.CloseBoxBackImageHover;
closeBtn.BackImagePressed = _owner.XTheme.CloseBoxBackImagePressed;
// max res box
if (_owner.MaximizeBox)
{
maxBtn.ColorTable = _owner.XTheme.MaxBoxColor;
maxBtn.BackImageNormal = _owner.XTheme.MaxBoxBackImageNormal;
maxBtn.BackImageHover = _owner.XTheme.MaxBoxBackImageHover;
maxBtn.BackImagePressed = _owner.XTheme.MaxBoxBackImagePressed;
resBtn.ColorTable = _owner.XTheme.MaxBoxColor;
resBtn.BackImageNormal = _owner.XTheme.ResBoxBackImageNormal;
resBtn.BackImageHover = _owner.XTheme.ResBoxBackImageHover;
resBtn.BackImagePressed = _owner.XTheme.ResBoxBackImagePressed;
}
// min box
if (_owner.MinimizeBox)
{
minBtn.ColorTable = _owner.XTheme.MinBoxColor;
minBtn.BackImageNormal = _owner.XTheme.MinBoxBackImageNormal;
minBtn.BackImageHover = _owner.XTheme.MinBoxBackImageHover;
minBtn.BackImagePressed = _owner.XTheme.MinBoxBackImagePressed;
}
}
private void BtnIni()
{
// close box
closeBtn = new WLButton(_owner);
closeBtn.Visible = true;
closeBtn.Bounds = _owner.CloseBoxRect;
closeBtn.Click += new EventHandler(CloseBtnClick);
closeBtn.ForePathGetter = new ButtonForePathGetter(
GraphicsPathHelper.CreateCloseFlagPath);
// max res box
if (_owner.MaximizeBox)
{
maxBtn = new WLButton(_owner);
resBtn = new WLButton(_owner);
if (_owner.WindowState == FormWindowState.Normal)
{
maxBtn.Visible = true;
resBtn.Visible = false;
}
else
{
maxBtn.Visible = false;
resBtn.Visible = true;
}
maxBtn.Bounds = _owner.MaxBoxRect;
resBtn.Bounds = _owner.MaxBoxRect;
maxBtn.Click += new EventHandler(MaxBtnClick);
maxBtn.ForePathGetter = new ButtonForePathGetter(
GraphicsPathHelper.CreateMaximizeFlagPath);
resBtn.Click += new EventHandler(ResBtnClick);
resBtn.ForePathGetter = new ButtonForePathGetter(
GraphicsPathHelper.CreateRestoreFlagPath);
}
// min box
if (_owner.MinimizeBox)
{
minBtn = new WLButton(_owner);
minBtn.Visible = true;
minBtn.Bounds = _owner.MinBoxRect;
minBtn.Click += new EventHandler(MinBtnClick);
minBtn.ForePathGetter = new ButtonForePathGetter(
GraphicsPathHelper.CreateMinimizeFlagPath);
}
SetControlBoxColor();
}
public ControlBoxManager(GMForm owner)
{
_owner = owner;
BtnIni();
}
public void FormResize()
{
if(maxBtn != null)
{
if (_owner.WindowState == FormWindowState.Normal)
{
maxBtn.Visible = true;
resBtn.Visible = false;
resBtn.State = GMButtonState.Normal;
}
else
{
resBtn.Visible = true;
maxBtn.Visible = false;
maxBtn.State = GMButtonState.Normal;
}
resBtn.Bounds = maxBtn.Bounds = _owner.MaxBoxRect;
}
if (minBtn != null)
minBtn.Bounds = _owner.MinBoxRect;
closeBtn.Bounds = _owner.CloseBoxRect;
}
public void MouseOperation(Point location, MouseOperationType type)
{
closeBtn.MouseOperation(location, type);
if (maxBtn != null && maxBtn.Visible)
maxBtn.MouseOperation(location, type);
if(resBtn!=null && resBtn.Visible)
resBtn.MouseOperation(location, type);
if(minBtn!=null)
minBtn.MouseOperation(location, type);
}
public void DrawBoxes(Graphics g)
{
if (_owner.ControlBox)
{
closeBtn.DrawButton(g);
if (_owner.MinimizeBox && minBtn != null)
minBtn.DrawButton(g);
if (_owner.MaximizeBox)
{
if (maxBtn != null & maxBtn.Visible)
maxBtn.DrawButton(g);
if (resBtn != null && resBtn.Visible)
resBtn.DrawButton(g);
}
}
}
public void ResetBoxColor()
{
SetControlBoxColor();
}
}
}
_owner.MaximumSize = new Size(curScreen.WorkingArea.Width, curScreen.WorkingArea.Height);
_owner.WindowState = FormWindowState.Maximized;
_owner.MaximumSize = MaximumSize;
}
private void ResBtnClick(object sender, EventArgs e)
{
_owner.WindowState = FormWindowState.Normal;
}
private void MinBtnClick(object sender, EventArgs e)
{
_owner.WindowState = FormWindowState.Minimized;
}
#endregion
private void SetControlBoxColor()
{
closeBtn.ColorTable = _owner.XTheme.CloseBoxColor;
closeBtn.BackImageNormal = _owner.XTheme.CloseBoxBackImageNormal;
closeBtn.BackImageHover = _owner.XTheme.CloseBoxBackImageHover;
closeBtn.BackImagePressed = _owner.XTheme.CloseBoxBackImagePressed;
// max res box
if (_owner.MaximizeBox)
{
maxBtn.ColorTable = _owner.XTheme.MaxBoxColor;
maxBtn.BackImageNormal = _owner.XTheme.MaxBoxBackImageNormal;
maxBtn.BackImageHover = _owner.XTheme.MaxBoxBackImageHover;
maxBtn.BackImagePressed = _owner.XTheme.MaxBoxBackImagePressed;
resBtn.ColorTable = _owner.XTheme.MaxBoxColor;
resBtn.BackImageNormal = _owner.XTheme.ResBoxBackImageNormal;
resBtn.BackImageHover = _owner.XTheme.ResBoxBackImageHover;
resBtn.BackImagePressed = _owner.XTheme.ResBoxBackImagePressed;
}
// min box
if (_owner.MinimizeBox)
{
minBtn.ColorTable = _owner.XTheme.MinBoxColor;
minBtn.BackImageNormal = _owner.XTheme.MinBoxBackImageNormal;
minBtn.BackImageHover = _owner.XTheme.MinBoxBackImageHover;
minBtn.BackImagePressed = _owner.XTheme.MinBoxBackImagePressed;
}
}
private void BtnIni()
{
// close box
closeBtn = new WLButton(_owner);
closeBtn.Visible = true;
closeBtn.Bounds = _owner.CloseBoxRect;
closeBtn.Click += new EventHandler(CloseBtnClick);
closeBtn.ForePathGetter = new ButtonForePathGetter(
GraphicsPathHelper.CreateCloseFlagPath);
// max res box
if (_owner.MaximizeBox)
{
var curScreen = Screen.FromControl(_owner);
_owner.MaximumSize = new Size(curScreen.WorkingArea.Width, curScreen.WorkingArea.Height);
maxBtn = new WLButton(_owner);
resBtn = new WLButton(_owner);
if (_owner.WindowState == FormWindowState.Normal)
{
maxBtn.Visible = true;
resBtn.Visible = false;
}
else
{
maxBtn.Visible = false;
resBtn.Visible = true;
}
maxBtn.Bounds = _owner.MaxBoxRect;
resBtn.Bounds = _owner.MaxBoxRect;
maxBtn.Click += new EventHandler(MaxBtnClick);
maxBtn.ForePathGetter = new ButtonForePathGetter(
GraphicsPathHelper.CreateMaximizeFlagPath);
resBtn.Click += new EventHandler(ResBtnClick);
resBtn.ForePathGetter = new ButtonForePathGetter(
GraphicsPathHelper.CreateRestoreFlagPath);
}
// min box
if (_owner.MinimizeBox)
{
minBtn = new WLButton(_owner);
minBtn.Visible = true;
minBtn.Bounds = _owner.MinBoxRect;
minBtn.Click += new EventHandler(MinBtnClick);
minBtn.ForePathGetter = new ButtonForePathGetter(
GraphicsPathHelper.CreateMinimizeFlagPath);
}
SetControlBoxColor();
}
public ControlBoxManager(GMForm owner)
{
_owner = owner;
BtnIni();
}
public void FormResize()
{
if(maxBtn != null)
{
if (_owner.WindowState == FormWindowState.Normal)
{
maxBtn.Visible = true;
resBtn.Visible = false;
resBtn.State = GMButtonState.Normal;
}
else
{
resBtn.Visible = true;
maxBtn.Visible = false;
maxBtn.State = GMButtonState.Normal;
}
resBtn.Bounds = maxBtn.Bounds = _owner.MaxBoxRect;
}
if (minBtn != null)
minBtn.Bounds = _owner.MinBoxRect;
closeBtn.Bounds = _owner.CloseBoxRect;
}
public void MouseOperation(Point location, MouseOperationType type)
{
closeBtn.MouseOperation(location, type);
if (maxBtn != null && maxBtn.Visible)
maxBtn.MouseOperation(location, type);
if(resBtn!=null && resBtn.Visible)
resBtn.MouseOperation(location, type);
if(minBtn!=null)
minBtn.MouseOperation(location, type);
}
public void DrawBoxes(Graphics g)
{
if (_owner.ControlBox)
{
closeBtn.DrawButton(g);
if (_owner.MinimizeBox && minBtn != null)
minBtn.DrawButton(g);
if (_owner.MaximizeBox)
{
if (maxBtn != null & maxBtn.Visible)
maxBtn.DrawButton(g);
if (resBtn != null && resBtn.Visible)
resBtn.DrawButton(g);
}
}
}
public void ResetBoxColor()
{
SetControlBoxColor();
}
}
}

View File

@ -969,7 +969,7 @@ namespace MGdu.WinFormUI
if (base.WindowState == FormWindowState.Normal)
{
var size = base.Size;
if (!this.DesignMode)
//if (!this.DesignMode)
{
size.Width += XTheme.ShadowWidth * 2;
size.Height += XTheme.ShadowWidth * 2;

View File

@ -32,5 +32,5 @@ using System.Runtime.InteropServices;
//可以指定所有这些值,也可以使用“生成号”和“修订号”的默认值,
// 方法是按如下所示使用“*”: :
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("3.0.2105.2201")]
[assembly: AssemblyFileVersion("3.0.2105.2201")]
[assembly: AssemblyVersion("3.0.2106.1301")]
[assembly: AssemblyFileVersion("3.0.2106.1301")]