diff --git a/RbFreqStandMeasure/Program.cs b/RbFreqStandMeasure/Program.cs index 0e902ab..93a83e5 100644 --- a/RbFreqStandMeasure/Program.cs +++ b/RbFreqStandMeasure/Program.cs @@ -15,7 +15,8 @@ { Application.EnableVisualStyles(); Application.SetCompatibleTextRenderingDefault(false); - Application.Run(new RbFreqStandMeasureForm()); + // Application.Run(new RbFreqStandMeasureForm()); + Application.Run(new RbFreqStdMeas()); } } } diff --git a/RbFreqStandMeasure/Program.cs b/RbFreqStandMeasure/Program.cs index 0e902ab..93a83e5 100644 --- a/RbFreqStandMeasure/Program.cs +++ b/RbFreqStandMeasure/Program.cs @@ -15,7 +15,8 @@ { Application.EnableVisualStyles(); Application.SetCompatibleTextRenderingDefault(false); - Application.Run(new RbFreqStandMeasureForm()); + // Application.Run(new RbFreqStandMeasureForm()); + Application.Run(new RbFreqStdMeas()); } } } diff --git a/RbFreqStandMeasure/Properties/Resources.Designer.cs b/RbFreqStandMeasure/Properties/Resources.Designer.cs index 716ac6d..253d7d7 100644 --- a/RbFreqStandMeasure/Properties/Resources.Designer.cs +++ b/RbFreqStandMeasure/Properties/Resources.Designer.cs @@ -63,11 +63,71 @@ /// /// 查找 System.Drawing.Bitmap 类型的本地化资源。 /// + internal static System.Drawing.Bitmap bg_banner { + get { + object obj = ResourceManager.GetObject("bg_banner", resourceCulture); + return ((System.Drawing.Bitmap)(obj)); + } + } + + /// + /// 查找 System.Drawing.Bitmap 类型的本地化资源。 + /// internal static System.Drawing.Bitmap bg_white_shadow { get { object obj = ResourceManager.GetObject("bg_white_shadow", resourceCulture); return ((System.Drawing.Bitmap)(obj)); } } + + /// + /// 查找 System.Drawing.Bitmap 类型的本地化资源。 + /// + internal static System.Drawing.Bitmap icon_exit { + get { + object obj = ResourceManager.GetObject("icon_exit", resourceCulture); + return ((System.Drawing.Bitmap)(obj)); + } + } + + /// + /// 查找 System.Drawing.Bitmap 类型的本地化资源。 + /// + internal static System.Drawing.Bitmap icon_home { + get { + object obj = ResourceManager.GetObject("icon_home", resourceCulture); + return ((System.Drawing.Bitmap)(obj)); + } + } + + /// + /// 查找 System.Drawing.Bitmap 类型的本地化资源。 + /// + internal static System.Drawing.Bitmap icon_home_selected { + get { + object obj = ResourceManager.GetObject("icon_home_selected", resourceCulture); + return ((System.Drawing.Bitmap)(obj)); + } + } + + /// + /// 查找 System.Drawing.Bitmap 类型的本地化资源。 + /// + internal static System.Drawing.Bitmap icon_status { + get { + object obj = ResourceManager.GetObject("icon_status", resourceCulture); + return ((System.Drawing.Bitmap)(obj)); + } + } + + /// + /// 查找 System.Drawing.Bitmap 类型的本地化资源。 + /// + internal static System.Drawing.Bitmap icon_status_selected { + get { + object obj = ResourceManager.GetObject("icon_status_selected", resourceCulture); + return ((System.Drawing.Bitmap)(obj)); + } + } } } diff --git a/RbFreqStandMeasure/Program.cs b/RbFreqStandMeasure/Program.cs index 0e902ab..93a83e5 100644 --- a/RbFreqStandMeasure/Program.cs +++ b/RbFreqStandMeasure/Program.cs @@ -15,7 +15,8 @@ { Application.EnableVisualStyles(); Application.SetCompatibleTextRenderingDefault(false); - Application.Run(new RbFreqStandMeasureForm()); + // Application.Run(new RbFreqStandMeasureForm()); + Application.Run(new RbFreqStdMeas()); } } } diff --git a/RbFreqStandMeasure/Properties/Resources.Designer.cs b/RbFreqStandMeasure/Properties/Resources.Designer.cs index 716ac6d..253d7d7 100644 --- a/RbFreqStandMeasure/Properties/Resources.Designer.cs +++ b/RbFreqStandMeasure/Properties/Resources.Designer.cs @@ -63,11 +63,71 @@ /// /// 查找 System.Drawing.Bitmap 类型的本地化资源。 /// + internal static System.Drawing.Bitmap bg_banner { + get { + object obj = ResourceManager.GetObject("bg_banner", resourceCulture); + return ((System.Drawing.Bitmap)(obj)); + } + } + + /// + /// 查找 System.Drawing.Bitmap 类型的本地化资源。 + /// internal static System.Drawing.Bitmap bg_white_shadow { get { object obj = ResourceManager.GetObject("bg_white_shadow", resourceCulture); return ((System.Drawing.Bitmap)(obj)); } } + + /// + /// 查找 System.Drawing.Bitmap 类型的本地化资源。 + /// + internal static System.Drawing.Bitmap icon_exit { + get { + object obj = ResourceManager.GetObject("icon_exit", resourceCulture); + return ((System.Drawing.Bitmap)(obj)); + } + } + + /// + /// 查找 System.Drawing.Bitmap 类型的本地化资源。 + /// + internal static System.Drawing.Bitmap icon_home { + get { + object obj = ResourceManager.GetObject("icon_home", resourceCulture); + return ((System.Drawing.Bitmap)(obj)); + } + } + + /// + /// 查找 System.Drawing.Bitmap 类型的本地化资源。 + /// + internal static System.Drawing.Bitmap icon_home_selected { + get { + object obj = ResourceManager.GetObject("icon_home_selected", resourceCulture); + return ((System.Drawing.Bitmap)(obj)); + } + } + + /// + /// 查找 System.Drawing.Bitmap 类型的本地化资源。 + /// + internal static System.Drawing.Bitmap icon_status { + get { + object obj = ResourceManager.GetObject("icon_status", resourceCulture); + return ((System.Drawing.Bitmap)(obj)); + } + } + + /// + /// 查找 System.Drawing.Bitmap 类型的本地化资源。 + /// + internal static System.Drawing.Bitmap icon_status_selected { + get { + object obj = ResourceManager.GetObject("icon_status_selected", resourceCulture); + return ((System.Drawing.Bitmap)(obj)); + } + } } } diff --git a/RbFreqStandMeasure/Properties/Resources.resx b/RbFreqStandMeasure/Properties/Resources.resx index 1435dab..e781bb7 100644 --- a/RbFreqStandMeasure/Properties/Resources.resx +++ b/RbFreqStandMeasure/Properties/Resources.resx @@ -118,7 +118,25 @@ System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + ..\res\images\icon_exit.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + ..\res\images\bg_white_shadow.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + ..\res\images\icon_home_selected.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + + ..\res\images\bg_banner.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + + ..\res\images\icon_home.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + + ..\res\images\icon_status.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + + ..\res\images\icon_status_selected.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + \ No newline at end of file diff --git a/RbFreqStandMeasure/Program.cs b/RbFreqStandMeasure/Program.cs index 0e902ab..93a83e5 100644 --- a/RbFreqStandMeasure/Program.cs +++ b/RbFreqStandMeasure/Program.cs @@ -15,7 +15,8 @@ { Application.EnableVisualStyles(); Application.SetCompatibleTextRenderingDefault(false); - Application.Run(new RbFreqStandMeasureForm()); + // Application.Run(new RbFreqStandMeasureForm()); + Application.Run(new RbFreqStdMeas()); } } } diff --git a/RbFreqStandMeasure/Properties/Resources.Designer.cs b/RbFreqStandMeasure/Properties/Resources.Designer.cs index 716ac6d..253d7d7 100644 --- a/RbFreqStandMeasure/Properties/Resources.Designer.cs +++ b/RbFreqStandMeasure/Properties/Resources.Designer.cs @@ -63,11 +63,71 @@ /// /// 查找 System.Drawing.Bitmap 类型的本地化资源。 /// + internal static System.Drawing.Bitmap bg_banner { + get { + object obj = ResourceManager.GetObject("bg_banner", resourceCulture); + return ((System.Drawing.Bitmap)(obj)); + } + } + + /// + /// 查找 System.Drawing.Bitmap 类型的本地化资源。 + /// internal static System.Drawing.Bitmap bg_white_shadow { get { object obj = ResourceManager.GetObject("bg_white_shadow", resourceCulture); return ((System.Drawing.Bitmap)(obj)); } } + + /// + /// 查找 System.Drawing.Bitmap 类型的本地化资源。 + /// + internal static System.Drawing.Bitmap icon_exit { + get { + object obj = ResourceManager.GetObject("icon_exit", resourceCulture); + return ((System.Drawing.Bitmap)(obj)); + } + } + + /// + /// 查找 System.Drawing.Bitmap 类型的本地化资源。 + /// + internal static System.Drawing.Bitmap icon_home { + get { + object obj = ResourceManager.GetObject("icon_home", resourceCulture); + return ((System.Drawing.Bitmap)(obj)); + } + } + + /// + /// 查找 System.Drawing.Bitmap 类型的本地化资源。 + /// + internal static System.Drawing.Bitmap icon_home_selected { + get { + object obj = ResourceManager.GetObject("icon_home_selected", resourceCulture); + return ((System.Drawing.Bitmap)(obj)); + } + } + + /// + /// 查找 System.Drawing.Bitmap 类型的本地化资源。 + /// + internal static System.Drawing.Bitmap icon_status { + get { + object obj = ResourceManager.GetObject("icon_status", resourceCulture); + return ((System.Drawing.Bitmap)(obj)); + } + } + + /// + /// 查找 System.Drawing.Bitmap 类型的本地化资源。 + /// + internal static System.Drawing.Bitmap icon_status_selected { + get { + object obj = ResourceManager.GetObject("icon_status_selected", resourceCulture); + return ((System.Drawing.Bitmap)(obj)); + } + } } } diff --git a/RbFreqStandMeasure/Properties/Resources.resx b/RbFreqStandMeasure/Properties/Resources.resx index 1435dab..e781bb7 100644 --- a/RbFreqStandMeasure/Properties/Resources.resx +++ b/RbFreqStandMeasure/Properties/Resources.resx @@ -118,7 +118,25 @@ System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + ..\res\images\icon_exit.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + ..\res\images\bg_white_shadow.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + ..\res\images\icon_home_selected.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + + ..\res\images\bg_banner.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + + ..\res\images\icon_home.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + + ..\res\images\icon_status.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + + ..\res\images\icon_status_selected.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + \ No newline at end of file diff --git a/RbFreqStandMeasure/RbFreqStandMeasure.csproj b/RbFreqStandMeasure/RbFreqStandMeasure.csproj index 35f244d..f5e7da9 100644 --- a/RbFreqStandMeasure/RbFreqStandMeasure.csproj +++ b/RbFreqStandMeasure/RbFreqStandMeasure.csproj @@ -126,6 +126,12 @@ + + Form + + + RbFreqStdMeas.cs + Component @@ -174,6 +180,9 @@ Resources.resx True + + RbFreqStdMeas.cs + SettingCtrlForm.cs @@ -205,6 +214,24 @@ + + + + + + + + + + + + + + + + + + diff --git a/RbFreqStandMeasure/Program.cs b/RbFreqStandMeasure/Program.cs index 0e902ab..93a83e5 100644 --- a/RbFreqStandMeasure/Program.cs +++ b/RbFreqStandMeasure/Program.cs @@ -15,7 +15,8 @@ { Application.EnableVisualStyles(); Application.SetCompatibleTextRenderingDefault(false); - Application.Run(new RbFreqStandMeasureForm()); + // Application.Run(new RbFreqStandMeasureForm()); + Application.Run(new RbFreqStdMeas()); } } } diff --git a/RbFreqStandMeasure/Properties/Resources.Designer.cs b/RbFreqStandMeasure/Properties/Resources.Designer.cs index 716ac6d..253d7d7 100644 --- a/RbFreqStandMeasure/Properties/Resources.Designer.cs +++ b/RbFreqStandMeasure/Properties/Resources.Designer.cs @@ -63,11 +63,71 @@ /// /// 查找 System.Drawing.Bitmap 类型的本地化资源。 /// + internal static System.Drawing.Bitmap bg_banner { + get { + object obj = ResourceManager.GetObject("bg_banner", resourceCulture); + return ((System.Drawing.Bitmap)(obj)); + } + } + + /// + /// 查找 System.Drawing.Bitmap 类型的本地化资源。 + /// internal static System.Drawing.Bitmap bg_white_shadow { get { object obj = ResourceManager.GetObject("bg_white_shadow", resourceCulture); return ((System.Drawing.Bitmap)(obj)); } } + + /// + /// 查找 System.Drawing.Bitmap 类型的本地化资源。 + /// + internal static System.Drawing.Bitmap icon_exit { + get { + object obj = ResourceManager.GetObject("icon_exit", resourceCulture); + return ((System.Drawing.Bitmap)(obj)); + } + } + + /// + /// 查找 System.Drawing.Bitmap 类型的本地化资源。 + /// + internal static System.Drawing.Bitmap icon_home { + get { + object obj = ResourceManager.GetObject("icon_home", resourceCulture); + return ((System.Drawing.Bitmap)(obj)); + } + } + + /// + /// 查找 System.Drawing.Bitmap 类型的本地化资源。 + /// + internal static System.Drawing.Bitmap icon_home_selected { + get { + object obj = ResourceManager.GetObject("icon_home_selected", resourceCulture); + return ((System.Drawing.Bitmap)(obj)); + } + } + + /// + /// 查找 System.Drawing.Bitmap 类型的本地化资源。 + /// + internal static System.Drawing.Bitmap icon_status { + get { + object obj = ResourceManager.GetObject("icon_status", resourceCulture); + return ((System.Drawing.Bitmap)(obj)); + } + } + + /// + /// 查找 System.Drawing.Bitmap 类型的本地化资源。 + /// + internal static System.Drawing.Bitmap icon_status_selected { + get { + object obj = ResourceManager.GetObject("icon_status_selected", resourceCulture); + return ((System.Drawing.Bitmap)(obj)); + } + } } } diff --git a/RbFreqStandMeasure/Properties/Resources.resx b/RbFreqStandMeasure/Properties/Resources.resx index 1435dab..e781bb7 100644 --- a/RbFreqStandMeasure/Properties/Resources.resx +++ b/RbFreqStandMeasure/Properties/Resources.resx @@ -118,7 +118,25 @@ System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + ..\res\images\icon_exit.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + ..\res\images\bg_white_shadow.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + ..\res\images\icon_home_selected.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + + ..\res\images\bg_banner.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + + ..\res\images\icon_home.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + + ..\res\images\icon_status.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + + ..\res\images\icon_status_selected.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + \ No newline at end of file diff --git a/RbFreqStandMeasure/RbFreqStandMeasure.csproj b/RbFreqStandMeasure/RbFreqStandMeasure.csproj index 35f244d..f5e7da9 100644 --- a/RbFreqStandMeasure/RbFreqStandMeasure.csproj +++ b/RbFreqStandMeasure/RbFreqStandMeasure.csproj @@ -126,6 +126,12 @@ + + Form + + + RbFreqStdMeas.cs + Component @@ -174,6 +180,9 @@ Resources.resx True + + RbFreqStdMeas.cs + SettingCtrlForm.cs @@ -205,6 +214,24 @@ + + + + + + + + + + + + + + + + + + diff --git a/RbFreqStandMeasure/RbFreqStdMeas.Designer.cs b/RbFreqStandMeasure/RbFreqStdMeas.Designer.cs new file mode 100644 index 0000000..57778cf --- /dev/null +++ b/RbFreqStandMeasure/RbFreqStdMeas.Designer.cs @@ -0,0 +1,248 @@ + +namespace Casic.Birmm.RbFreqStandMeasure +{ + partial class RbFreqStdMeas + { + /// + /// Required designer variable. + /// + private System.ComponentModel.IContainer components = null; + + /// + /// Clean up any resources being used. + /// + /// true if managed resources should be disposed; otherwise, false. + protected override void Dispose(bool disposing) + { + if (disposing && (components != null)) + { + components.Dispose(); + } + base.Dispose(disposing); + } + + #region Windows Form Designer generated code + + /// + /// Required method for Designer support - do not modify + /// the contents of this method with the code editor. + /// + private void InitializeComponent() + { + this.panMenu = new System.Windows.Forms.Panel(); + this.panStatus = new Casic.Birmm.RbFreqStandMeasure.RoundPanel(); + this.labStatusText = new System.Windows.Forms.Label(); + this.picIconStatus = new System.Windows.Forms.PictureBox(); + this.panHome = new Casic.Birmm.RbFreqStandMeasure.RoundPanel(); + this.labHomeText = new System.Windows.Forms.Label(); + this.picIconHome = new System.Windows.Forms.PictureBox(); + this.labHomeSelected = new System.Windows.Forms.Label(); + this.labStatusSelected = new System.Windows.Forms.Label(); + this.penBanner = new System.Windows.Forms.Panel(); + this.btnExitSys = new System.Windows.Forms.Button(); + this.labTitle = new System.Windows.Forms.Label(); + this.panMenu.SuspendLayout(); + this.panStatus.SuspendLayout(); + ((System.ComponentModel.ISupportInitialize)(this.picIconStatus)).BeginInit(); + this.panHome.SuspendLayout(); + ((System.ComponentModel.ISupportInitialize)(this.picIconHome)).BeginInit(); + this.penBanner.SuspendLayout(); + this.SuspendLayout(); + // + // panMenu + // + this.panMenu.BackColor = System.Drawing.Color.White; + this.panMenu.Controls.Add(this.panStatus); + this.panMenu.Controls.Add(this.panHome); + this.panMenu.Controls.Add(this.labStatusSelected); + this.panMenu.Location = new System.Drawing.Point(0, 64); + this.panMenu.Name = "panMenu"; + this.panMenu.Size = new System.Drawing.Size(1024, 50); + this.panMenu.TabIndex = 1; + // + // panStatus + // + this.panStatus.Back = System.Drawing.Color.Empty; + this.panStatus.BackColor = System.Drawing.Color.Transparent; + this.panStatus.Controls.Add(this.labStatusText); + this.panStatus.Controls.Add(this.picIconStatus); + this.panStatus.Location = new System.Drawing.Point(160, 0); + this.panStatus.MatrixRound = 8; + this.panStatus.Name = "panStatus"; + this.panStatus.Size = new System.Drawing.Size(130, 47); + this.panStatus.TabIndex = 1; + this.panStatus.Click += new System.EventHandler(this.panStatus_Click); + this.panStatus.MouseLeave += new System.EventHandler(this.panStatus_MouseLeave); + this.panStatus.MouseHover += new System.EventHandler(this.panStatus_MouseHover); + // + // labStatusText + // + this.labStatusText.BackColor = System.Drawing.Color.Transparent; + this.labStatusText.Cursor = System.Windows.Forms.Cursors.Hand; + this.labStatusText.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); + this.labStatusText.ForeColor = System.Drawing.SystemColors.ControlText; + this.labStatusText.Location = new System.Drawing.Point(35, 0); + this.labStatusText.Margin = new System.Windows.Forms.Padding(0); + this.labStatusText.Name = "labStatusText"; + this.labStatusText.Size = new System.Drawing.Size(85, 47); + this.labStatusText.TabIndex = 2; + this.labStatusText.Text = "基准状态"; + this.labStatusText.TextAlign = System.Drawing.ContentAlignment.MiddleRight; + this.labStatusText.Click += new System.EventHandler(this.panStatus_Click); + this.labStatusText.MouseLeave += new System.EventHandler(this.panStatus_MouseLeave); + this.labStatusText.MouseHover += new System.EventHandler(this.panStatus_MouseHover); + // + // picIconStatus + // + this.picIconStatus.BackgroundImage = global::Casic.Birmm.RbFreqStandMeasure.Properties.Resources.icon_status; + this.picIconStatus.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Zoom; + this.picIconStatus.Location = new System.Drawing.Point(10, 11); + this.picIconStatus.Name = "picIconStatus"; + this.picIconStatus.Size = new System.Drawing.Size(25, 25); + this.picIconStatus.TabIndex = 1; + this.picIconStatus.TabStop = false; + this.picIconStatus.Click += new System.EventHandler(this.panStatus_Click); + this.picIconStatus.MouseLeave += new System.EventHandler(this.panStatus_MouseLeave); + this.picIconStatus.MouseHover += new System.EventHandler(this.panStatus_MouseHover); + // + // panHome + // + this.panHome.Back = System.Drawing.Color.Empty; + this.panHome.Controls.Add(this.labHomeText); + this.panHome.Controls.Add(this.picIconHome); + this.panHome.Controls.Add(this.labHomeSelected); + this.panHome.Cursor = System.Windows.Forms.Cursors.Hand; + this.panHome.Location = new System.Drawing.Point(30, 0); + this.panHome.MatrixRound = 8; + this.panHome.Name = "panHome"; + this.panHome.Size = new System.Drawing.Size(100, 50); + this.panHome.TabIndex = 0; + this.panHome.Click += new System.EventHandler(this.panHome_Click); + this.panHome.MouseLeave += new System.EventHandler(this.panHome_MouseLeave); + this.panHome.MouseHover += new System.EventHandler(this.panHome_MouseHover); + // + // labHomeText + // + this.labHomeText.BackColor = System.Drawing.Color.Transparent; + this.labHomeText.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); + this.labHomeText.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(18)))), ((int)(((byte)(150)))), ((int)(((byte)(219))))); + this.labHomeText.Location = new System.Drawing.Point(35, 0); + this.labHomeText.Margin = new System.Windows.Forms.Padding(0); + this.labHomeText.Name = "labHomeText"; + this.labHomeText.Size = new System.Drawing.Size(55, 47); + this.labHomeText.TabIndex = 2; + this.labHomeText.Text = "首页"; + this.labHomeText.TextAlign = System.Drawing.ContentAlignment.MiddleRight; + this.labHomeText.Click += new System.EventHandler(this.panHome_Click); + this.labHomeText.MouseLeave += new System.EventHandler(this.panHome_MouseLeave); + this.labHomeText.MouseHover += new System.EventHandler(this.panHome_MouseHover); + // + // picIconHome + // + this.picIconHome.BackColor = System.Drawing.Color.Transparent; + this.picIconHome.BackgroundImage = global::Casic.Birmm.RbFreqStandMeasure.Properties.Resources.icon_home_selected; + this.picIconHome.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Zoom; + this.picIconHome.Location = new System.Drawing.Point(10, 11); + this.picIconHome.Name = "picIconHome"; + this.picIconHome.Size = new System.Drawing.Size(25, 25); + this.picIconHome.TabIndex = 1; + this.picIconHome.TabStop = false; + this.picIconHome.Click += new System.EventHandler(this.panHome_Click); + this.picIconHome.MouseLeave += new System.EventHandler(this.panHome_MouseLeave); + this.picIconHome.MouseHover += new System.EventHandler(this.panHome_MouseHover); + // + // labHomeSelected + // + this.labHomeSelected.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(18)))), ((int)(((byte)(150)))), ((int)(((byte)(219))))); + this.labHomeSelected.Location = new System.Drawing.Point(0, 47); + this.labHomeSelected.Name = "labHomeSelected"; + this.labHomeSelected.Size = new System.Drawing.Size(100, 3); + this.labHomeSelected.TabIndex = 0; + // + // labStatusSelected + // + this.labStatusSelected.BackColor = System.Drawing.Color.Transparent; + this.labStatusSelected.Location = new System.Drawing.Point(160, 47); + this.labStatusSelected.Margin = new System.Windows.Forms.Padding(0); + this.labStatusSelected.Name = "labStatusSelected"; + this.labStatusSelected.Size = new System.Drawing.Size(130, 3); + this.labStatusSelected.TabIndex = 0; + // + // penBanner + // + this.penBanner.BackgroundImage = global::Casic.Birmm.RbFreqStandMeasure.Properties.Resources.bg_banner; + this.penBanner.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Stretch; + this.penBanner.Controls.Add(this.btnExitSys); + this.penBanner.Controls.Add(this.labTitle); + this.penBanner.Location = new System.Drawing.Point(0, 0); + this.penBanner.Name = "penBanner"; + this.penBanner.Size = new System.Drawing.Size(1024, 64); + this.penBanner.TabIndex = 0; + this.penBanner.MouseDown += new System.Windows.Forms.MouseEventHandler(this.RbFreqStdMeas_MouseDown); + // + // btnExitSys + // + this.btnExitSys.BackColor = System.Drawing.Color.Transparent; + this.btnExitSys.BackgroundImage = global::Casic.Birmm.RbFreqStandMeasure.Properties.Resources.icon_exit; + this.btnExitSys.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Stretch; + this.btnExitSys.FlatAppearance.BorderSize = 0; + this.btnExitSys.FlatStyle = System.Windows.Forms.FlatStyle.Flat; + this.btnExitSys.ForeColor = System.Drawing.SystemColors.ControlDarkDark; + this.btnExitSys.Location = new System.Drawing.Point(974, 22); + this.btnExitSys.Margin = new System.Windows.Forms.Padding(0); + this.btnExitSys.Name = "btnExitSys"; + this.btnExitSys.Size = new System.Drawing.Size(20, 20); + this.btnExitSys.TabIndex = 1; + this.btnExitSys.UseVisualStyleBackColor = false; + this.btnExitSys.Click += new System.EventHandler(this.btnExitSys_Click); + this.btnExitSys.MouseHover += new System.EventHandler(this.btnExitSys_MouseHover); + // + // labTitle + // + this.labTitle.BackColor = System.Drawing.Color.Transparent; + this.labTitle.Font = new System.Drawing.Font("微软雅黑", 15.75F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(134))); + this.labTitle.ForeColor = System.Drawing.Color.White; + this.labTitle.Location = new System.Drawing.Point(30, 16); + this.labTitle.Name = "labTitle"; + this.labTitle.Size = new System.Drawing.Size(300, 32); + this.labTitle.TabIndex = 0; + this.labTitle.Text = "铷原子频标比对测量软件"; + this.labTitle.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; + // + // RbFreqStdMeas + // + this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.ClientSize = new System.Drawing.Size(1024, 768); + this.Controls.Add(this.panMenu); + this.Controls.Add(this.penBanner); + this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.None; + this.Name = "RbFreqStdMeas"; + this.Text = "RbFreqStdMeas"; + this.Load += new System.EventHandler(this.RbFreqStdMeas_Load); + this.panMenu.ResumeLayout(false); + this.panStatus.ResumeLayout(false); + ((System.ComponentModel.ISupportInitialize)(this.picIconStatus)).EndInit(); + this.panHome.ResumeLayout(false); + ((System.ComponentModel.ISupportInitialize)(this.picIconHome)).EndInit(); + this.penBanner.ResumeLayout(false); + this.ResumeLayout(false); + + } + + #endregion + + private System.Windows.Forms.Panel penBanner; + private System.Windows.Forms.Label labTitle; + private System.Windows.Forms.Button btnExitSys; + private System.Windows.Forms.Panel panMenu; + private System.Windows.Forms.Label labHomeSelected; + private System.Windows.Forms.PictureBox picIconHome; + private System.Windows.Forms.Label labHomeText; + private System.Windows.Forms.Label labStatusText; + private System.Windows.Forms.PictureBox picIconStatus; + private RoundPanel panStatus; + private RoundPanel panHome; + private System.Windows.Forms.Label labStatusSelected; + } +} \ No newline at end of file diff --git a/RbFreqStandMeasure/Program.cs b/RbFreqStandMeasure/Program.cs index 0e902ab..93a83e5 100644 --- a/RbFreqStandMeasure/Program.cs +++ b/RbFreqStandMeasure/Program.cs @@ -15,7 +15,8 @@ { Application.EnableVisualStyles(); Application.SetCompatibleTextRenderingDefault(false); - Application.Run(new RbFreqStandMeasureForm()); + // Application.Run(new RbFreqStandMeasureForm()); + Application.Run(new RbFreqStdMeas()); } } } diff --git a/RbFreqStandMeasure/Properties/Resources.Designer.cs b/RbFreqStandMeasure/Properties/Resources.Designer.cs index 716ac6d..253d7d7 100644 --- a/RbFreqStandMeasure/Properties/Resources.Designer.cs +++ b/RbFreqStandMeasure/Properties/Resources.Designer.cs @@ -63,11 +63,71 @@ /// /// 查找 System.Drawing.Bitmap 类型的本地化资源。 /// + internal static System.Drawing.Bitmap bg_banner { + get { + object obj = ResourceManager.GetObject("bg_banner", resourceCulture); + return ((System.Drawing.Bitmap)(obj)); + } + } + + /// + /// 查找 System.Drawing.Bitmap 类型的本地化资源。 + /// internal static System.Drawing.Bitmap bg_white_shadow { get { object obj = ResourceManager.GetObject("bg_white_shadow", resourceCulture); return ((System.Drawing.Bitmap)(obj)); } } + + /// + /// 查找 System.Drawing.Bitmap 类型的本地化资源。 + /// + internal static System.Drawing.Bitmap icon_exit { + get { + object obj = ResourceManager.GetObject("icon_exit", resourceCulture); + return ((System.Drawing.Bitmap)(obj)); + } + } + + /// + /// 查找 System.Drawing.Bitmap 类型的本地化资源。 + /// + internal static System.Drawing.Bitmap icon_home { + get { + object obj = ResourceManager.GetObject("icon_home", resourceCulture); + return ((System.Drawing.Bitmap)(obj)); + } + } + + /// + /// 查找 System.Drawing.Bitmap 类型的本地化资源。 + /// + internal static System.Drawing.Bitmap icon_home_selected { + get { + object obj = ResourceManager.GetObject("icon_home_selected", resourceCulture); + return ((System.Drawing.Bitmap)(obj)); + } + } + + /// + /// 查找 System.Drawing.Bitmap 类型的本地化资源。 + /// + internal static System.Drawing.Bitmap icon_status { + get { + object obj = ResourceManager.GetObject("icon_status", resourceCulture); + return ((System.Drawing.Bitmap)(obj)); + } + } + + /// + /// 查找 System.Drawing.Bitmap 类型的本地化资源。 + /// + internal static System.Drawing.Bitmap icon_status_selected { + get { + object obj = ResourceManager.GetObject("icon_status_selected", resourceCulture); + return ((System.Drawing.Bitmap)(obj)); + } + } } } diff --git a/RbFreqStandMeasure/Properties/Resources.resx b/RbFreqStandMeasure/Properties/Resources.resx index 1435dab..e781bb7 100644 --- a/RbFreqStandMeasure/Properties/Resources.resx +++ b/RbFreqStandMeasure/Properties/Resources.resx @@ -118,7 +118,25 @@ System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + ..\res\images\icon_exit.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + ..\res\images\bg_white_shadow.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + ..\res\images\icon_home_selected.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + + ..\res\images\bg_banner.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + + ..\res\images\icon_home.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + + ..\res\images\icon_status.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + + ..\res\images\icon_status_selected.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + \ No newline at end of file diff --git a/RbFreqStandMeasure/RbFreqStandMeasure.csproj b/RbFreqStandMeasure/RbFreqStandMeasure.csproj index 35f244d..f5e7da9 100644 --- a/RbFreqStandMeasure/RbFreqStandMeasure.csproj +++ b/RbFreqStandMeasure/RbFreqStandMeasure.csproj @@ -126,6 +126,12 @@ + + Form + + + RbFreqStdMeas.cs + Component @@ -174,6 +180,9 @@ Resources.resx True + + RbFreqStdMeas.cs + SettingCtrlForm.cs @@ -205,6 +214,24 @@ + + + + + + + + + + + + + + + + + + diff --git a/RbFreqStandMeasure/RbFreqStdMeas.Designer.cs b/RbFreqStandMeasure/RbFreqStdMeas.Designer.cs new file mode 100644 index 0000000..57778cf --- /dev/null +++ b/RbFreqStandMeasure/RbFreqStdMeas.Designer.cs @@ -0,0 +1,248 @@ + +namespace Casic.Birmm.RbFreqStandMeasure +{ + partial class RbFreqStdMeas + { + /// + /// Required designer variable. + /// + private System.ComponentModel.IContainer components = null; + + /// + /// Clean up any resources being used. + /// + /// true if managed resources should be disposed; otherwise, false. + protected override void Dispose(bool disposing) + { + if (disposing && (components != null)) + { + components.Dispose(); + } + base.Dispose(disposing); + } + + #region Windows Form Designer generated code + + /// + /// Required method for Designer support - do not modify + /// the contents of this method with the code editor. + /// + private void InitializeComponent() + { + this.panMenu = new System.Windows.Forms.Panel(); + this.panStatus = new Casic.Birmm.RbFreqStandMeasure.RoundPanel(); + this.labStatusText = new System.Windows.Forms.Label(); + this.picIconStatus = new System.Windows.Forms.PictureBox(); + this.panHome = new Casic.Birmm.RbFreqStandMeasure.RoundPanel(); + this.labHomeText = new System.Windows.Forms.Label(); + this.picIconHome = new System.Windows.Forms.PictureBox(); + this.labHomeSelected = new System.Windows.Forms.Label(); + this.labStatusSelected = new System.Windows.Forms.Label(); + this.penBanner = new System.Windows.Forms.Panel(); + this.btnExitSys = new System.Windows.Forms.Button(); + this.labTitle = new System.Windows.Forms.Label(); + this.panMenu.SuspendLayout(); + this.panStatus.SuspendLayout(); + ((System.ComponentModel.ISupportInitialize)(this.picIconStatus)).BeginInit(); + this.panHome.SuspendLayout(); + ((System.ComponentModel.ISupportInitialize)(this.picIconHome)).BeginInit(); + this.penBanner.SuspendLayout(); + this.SuspendLayout(); + // + // panMenu + // + this.panMenu.BackColor = System.Drawing.Color.White; + this.panMenu.Controls.Add(this.panStatus); + this.panMenu.Controls.Add(this.panHome); + this.panMenu.Controls.Add(this.labStatusSelected); + this.panMenu.Location = new System.Drawing.Point(0, 64); + this.panMenu.Name = "panMenu"; + this.panMenu.Size = new System.Drawing.Size(1024, 50); + this.panMenu.TabIndex = 1; + // + // panStatus + // + this.panStatus.Back = System.Drawing.Color.Empty; + this.panStatus.BackColor = System.Drawing.Color.Transparent; + this.panStatus.Controls.Add(this.labStatusText); + this.panStatus.Controls.Add(this.picIconStatus); + this.panStatus.Location = new System.Drawing.Point(160, 0); + this.panStatus.MatrixRound = 8; + this.panStatus.Name = "panStatus"; + this.panStatus.Size = new System.Drawing.Size(130, 47); + this.panStatus.TabIndex = 1; + this.panStatus.Click += new System.EventHandler(this.panStatus_Click); + this.panStatus.MouseLeave += new System.EventHandler(this.panStatus_MouseLeave); + this.panStatus.MouseHover += new System.EventHandler(this.panStatus_MouseHover); + // + // labStatusText + // + this.labStatusText.BackColor = System.Drawing.Color.Transparent; + this.labStatusText.Cursor = System.Windows.Forms.Cursors.Hand; + this.labStatusText.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); + this.labStatusText.ForeColor = System.Drawing.SystemColors.ControlText; + this.labStatusText.Location = new System.Drawing.Point(35, 0); + this.labStatusText.Margin = new System.Windows.Forms.Padding(0); + this.labStatusText.Name = "labStatusText"; + this.labStatusText.Size = new System.Drawing.Size(85, 47); + this.labStatusText.TabIndex = 2; + this.labStatusText.Text = "基准状态"; + this.labStatusText.TextAlign = System.Drawing.ContentAlignment.MiddleRight; + this.labStatusText.Click += new System.EventHandler(this.panStatus_Click); + this.labStatusText.MouseLeave += new System.EventHandler(this.panStatus_MouseLeave); + this.labStatusText.MouseHover += new System.EventHandler(this.panStatus_MouseHover); + // + // picIconStatus + // + this.picIconStatus.BackgroundImage = global::Casic.Birmm.RbFreqStandMeasure.Properties.Resources.icon_status; + this.picIconStatus.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Zoom; + this.picIconStatus.Location = new System.Drawing.Point(10, 11); + this.picIconStatus.Name = "picIconStatus"; + this.picIconStatus.Size = new System.Drawing.Size(25, 25); + this.picIconStatus.TabIndex = 1; + this.picIconStatus.TabStop = false; + this.picIconStatus.Click += new System.EventHandler(this.panStatus_Click); + this.picIconStatus.MouseLeave += new System.EventHandler(this.panStatus_MouseLeave); + this.picIconStatus.MouseHover += new System.EventHandler(this.panStatus_MouseHover); + // + // panHome + // + this.panHome.Back = System.Drawing.Color.Empty; + this.panHome.Controls.Add(this.labHomeText); + this.panHome.Controls.Add(this.picIconHome); + this.panHome.Controls.Add(this.labHomeSelected); + this.panHome.Cursor = System.Windows.Forms.Cursors.Hand; + this.panHome.Location = new System.Drawing.Point(30, 0); + this.panHome.MatrixRound = 8; + this.panHome.Name = "panHome"; + this.panHome.Size = new System.Drawing.Size(100, 50); + this.panHome.TabIndex = 0; + this.panHome.Click += new System.EventHandler(this.panHome_Click); + this.panHome.MouseLeave += new System.EventHandler(this.panHome_MouseLeave); + this.panHome.MouseHover += new System.EventHandler(this.panHome_MouseHover); + // + // labHomeText + // + this.labHomeText.BackColor = System.Drawing.Color.Transparent; + this.labHomeText.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); + this.labHomeText.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(18)))), ((int)(((byte)(150)))), ((int)(((byte)(219))))); + this.labHomeText.Location = new System.Drawing.Point(35, 0); + this.labHomeText.Margin = new System.Windows.Forms.Padding(0); + this.labHomeText.Name = "labHomeText"; + this.labHomeText.Size = new System.Drawing.Size(55, 47); + this.labHomeText.TabIndex = 2; + this.labHomeText.Text = "首页"; + this.labHomeText.TextAlign = System.Drawing.ContentAlignment.MiddleRight; + this.labHomeText.Click += new System.EventHandler(this.panHome_Click); + this.labHomeText.MouseLeave += new System.EventHandler(this.panHome_MouseLeave); + this.labHomeText.MouseHover += new System.EventHandler(this.panHome_MouseHover); + // + // picIconHome + // + this.picIconHome.BackColor = System.Drawing.Color.Transparent; + this.picIconHome.BackgroundImage = global::Casic.Birmm.RbFreqStandMeasure.Properties.Resources.icon_home_selected; + this.picIconHome.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Zoom; + this.picIconHome.Location = new System.Drawing.Point(10, 11); + this.picIconHome.Name = "picIconHome"; + this.picIconHome.Size = new System.Drawing.Size(25, 25); + this.picIconHome.TabIndex = 1; + this.picIconHome.TabStop = false; + this.picIconHome.Click += new System.EventHandler(this.panHome_Click); + this.picIconHome.MouseLeave += new System.EventHandler(this.panHome_MouseLeave); + this.picIconHome.MouseHover += new System.EventHandler(this.panHome_MouseHover); + // + // labHomeSelected + // + this.labHomeSelected.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(18)))), ((int)(((byte)(150)))), ((int)(((byte)(219))))); + this.labHomeSelected.Location = new System.Drawing.Point(0, 47); + this.labHomeSelected.Name = "labHomeSelected"; + this.labHomeSelected.Size = new System.Drawing.Size(100, 3); + this.labHomeSelected.TabIndex = 0; + // + // labStatusSelected + // + this.labStatusSelected.BackColor = System.Drawing.Color.Transparent; + this.labStatusSelected.Location = new System.Drawing.Point(160, 47); + this.labStatusSelected.Margin = new System.Windows.Forms.Padding(0); + this.labStatusSelected.Name = "labStatusSelected"; + this.labStatusSelected.Size = new System.Drawing.Size(130, 3); + this.labStatusSelected.TabIndex = 0; + // + // penBanner + // + this.penBanner.BackgroundImage = global::Casic.Birmm.RbFreqStandMeasure.Properties.Resources.bg_banner; + this.penBanner.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Stretch; + this.penBanner.Controls.Add(this.btnExitSys); + this.penBanner.Controls.Add(this.labTitle); + this.penBanner.Location = new System.Drawing.Point(0, 0); + this.penBanner.Name = "penBanner"; + this.penBanner.Size = new System.Drawing.Size(1024, 64); + this.penBanner.TabIndex = 0; + this.penBanner.MouseDown += new System.Windows.Forms.MouseEventHandler(this.RbFreqStdMeas_MouseDown); + // + // btnExitSys + // + this.btnExitSys.BackColor = System.Drawing.Color.Transparent; + this.btnExitSys.BackgroundImage = global::Casic.Birmm.RbFreqStandMeasure.Properties.Resources.icon_exit; + this.btnExitSys.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Stretch; + this.btnExitSys.FlatAppearance.BorderSize = 0; + this.btnExitSys.FlatStyle = System.Windows.Forms.FlatStyle.Flat; + this.btnExitSys.ForeColor = System.Drawing.SystemColors.ControlDarkDark; + this.btnExitSys.Location = new System.Drawing.Point(974, 22); + this.btnExitSys.Margin = new System.Windows.Forms.Padding(0); + this.btnExitSys.Name = "btnExitSys"; + this.btnExitSys.Size = new System.Drawing.Size(20, 20); + this.btnExitSys.TabIndex = 1; + this.btnExitSys.UseVisualStyleBackColor = false; + this.btnExitSys.Click += new System.EventHandler(this.btnExitSys_Click); + this.btnExitSys.MouseHover += new System.EventHandler(this.btnExitSys_MouseHover); + // + // labTitle + // + this.labTitle.BackColor = System.Drawing.Color.Transparent; + this.labTitle.Font = new System.Drawing.Font("微软雅黑", 15.75F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(134))); + this.labTitle.ForeColor = System.Drawing.Color.White; + this.labTitle.Location = new System.Drawing.Point(30, 16); + this.labTitle.Name = "labTitle"; + this.labTitle.Size = new System.Drawing.Size(300, 32); + this.labTitle.TabIndex = 0; + this.labTitle.Text = "铷原子频标比对测量软件"; + this.labTitle.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; + // + // RbFreqStdMeas + // + this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.ClientSize = new System.Drawing.Size(1024, 768); + this.Controls.Add(this.panMenu); + this.Controls.Add(this.penBanner); + this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.None; + this.Name = "RbFreqStdMeas"; + this.Text = "RbFreqStdMeas"; + this.Load += new System.EventHandler(this.RbFreqStdMeas_Load); + this.panMenu.ResumeLayout(false); + this.panStatus.ResumeLayout(false); + ((System.ComponentModel.ISupportInitialize)(this.picIconStatus)).EndInit(); + this.panHome.ResumeLayout(false); + ((System.ComponentModel.ISupportInitialize)(this.picIconHome)).EndInit(); + this.penBanner.ResumeLayout(false); + this.ResumeLayout(false); + + } + + #endregion + + private System.Windows.Forms.Panel penBanner; + private System.Windows.Forms.Label labTitle; + private System.Windows.Forms.Button btnExitSys; + private System.Windows.Forms.Panel panMenu; + private System.Windows.Forms.Label labHomeSelected; + private System.Windows.Forms.PictureBox picIconHome; + private System.Windows.Forms.Label labHomeText; + private System.Windows.Forms.Label labStatusText; + private System.Windows.Forms.PictureBox picIconStatus; + private RoundPanel panStatus; + private RoundPanel panHome; + private System.Windows.Forms.Label labStatusSelected; + } +} \ No newline at end of file diff --git a/RbFreqStandMeasure/RbFreqStdMeas.cs b/RbFreqStandMeasure/RbFreqStdMeas.cs new file mode 100644 index 0000000..3858ddb --- /dev/null +++ b/RbFreqStandMeasure/RbFreqStdMeas.cs @@ -0,0 +1,195 @@ +using Casic.Birmm.RbFreqStandMeasure.Properties; +using System; +using System.Collections.Generic; +using System.ComponentModel; +using System.Data; +using System.Drawing; +using System.Linq; +using System.Resources; +using System.Runtime.InteropServices; +using System.Text; +using System.Windows.Forms; + +namespace Casic.Birmm.RbFreqStandMeasure +{ + public partial class RbFreqStdMeas : Form + { + + #region 无边框拖动效果 + [DllImport("user32.dll")]//拖动无窗体的控件 + public static extern bool ReleaseCapture(); + [DllImport("user32.dll")] + public static extern bool SendMessage(IntPtr hwnd, int wMsg, int wParam, int lParam); + public const int WM_SYSCOMMAND = 0x0112; + public const int SC_MOVE = 0xF010; + public const int HTCAPTION = 0x0002; + + private void RbFreqStdMeas_MouseDown(object sender, MouseEventArgs e) + { + //拖动窗体 + ReleaseCapture(); + SendMessage(this.Handle, WM_SYSCOMMAND, SC_MOVE + HTCAPTION, 0); + } + #endregion + + private bool[] menuSelected = { true, false }; + // 按钮图标 + private PictureBox[] menuPics; + // 按钮图标的资源名称(选中的资源名称在后面加上 _selected) + private string[] menuIconResources; + // 按钮文本 + private Label[] menuLabels; + // 按钮下划线 + private Label[] menuUnderlines; + + private void ClearAllMenuSelected() + { + // 找到当前选中的按钮 + int index = 0; + for (int i = 0; i < this.menuSelected.Length; i++) + { + if (this.menuSelected[i] == true) + { + index = i; + break; + } + } + + // 将当前按钮的效果设置为默认未选中 + this.menuPics[index].BackgroundImage = (Bitmap)Resources.ResourceManager.GetObject(this.menuIconResources[index], null); + this.menuLabels[index].ForeColor = ColorTranslator.FromHtml("#2C2C2C"); + this.menuUnderlines[index].BackColor = Color.Transparent; + } + + #region 首页按钮点击、鼠标移入/移出效果 + private void HoverHome() + { + panHome.Back = ColorTranslator.FromHtml("#56a3f2"); + } + private void LeaveHome() + { + panHome.Back = Color.Transparent; + } + private void SelectHome() + { + // 移除所有按钮的选中样式 + this.ClearAllMenuSelected(); + + // 鼠标移入效果去掉 + LeaveHome(); + + // 重新设置所有按钮的状态 + this.menuSelected = new bool[] { true, false }; + + // 将新选中的按钮设置为选中 + this.picIconHome.BackgroundImage = (Bitmap)Resources.ResourceManager.GetObject("icon_home_selected", null); + this.labHomeText.ForeColor = ColorTranslator.FromHtml("#1296db"); + this.labHomeSelected.BackColor = ColorTranslator.FromHtml("#1296db"); + + } + #endregion + + #region 基准状态按钮点击、移入/移出效果 + private void HoverStatus() + { + panStatus.Back = ColorTranslator.FromHtml("#56a3f2"); + } + private void LeaveStatus() + { + panStatus.Back = Color.Transparent; + } + private void SelectStatus() + { + // 移除所有按钮的选中样式 + this.ClearAllMenuSelected(); + + // 鼠标移入效果去掉 + LeaveStatus(); + + // 重新设置所有按钮的状态 + this.menuSelected = new bool[] { false, true }; + + // 将新选中的按钮设置为选中 + this.picIconStatus.BackgroundImage = (Bitmap) Resources.ResourceManager.GetObject("icon_status_selected", null); + this.labStatusText.ForeColor = ColorTranslator.FromHtml("#1296db"); + this.labStatusSelected.BackColor = ColorTranslator.FromHtml("#1296db"); + } + #endregion + + public RbFreqStdMeas() + { + InitializeComponent(); + } + + private void RbFreqStdMeas_Load(object sender, EventArgs e) + { + this.menuPics = new PictureBox[] { this.picIconHome, this.picIconStatus }; + this.menuLabels = new Label[] { this.labHomeText, this.labStatusText }; + this.menuUnderlines = new Label[] { this.labHomeSelected, this.labStatusSelected }; + this.menuIconResources = new string[] { "icon_home", "icon_status" }; + } + + private void btnExitSys_Click(object sender, EventArgs e) + { + Application.Exit(); + } + + private void btnExitSys_MouseHover(object sender, EventArgs e) + { + ToolTip p = new ToolTip(); + p.ShowAlways = true; + p.SetToolTip(this.btnExitSys, "退出"); + } + + private void panHome_Click(object sender, EventArgs e) + { + if (this.menuSelected[0] == false) + { + this.SelectHome(); + } + } + + private void panHome_MouseHover(object sender, EventArgs e) + { + // 没有选中首页时才动作 + if (this.menuSelected[0] == false) + { + HoverHome(); + } + } + + private void panHome_MouseLeave(object sender, EventArgs e) + { + // 没有选中首页时才动作 + if (this.menuSelected[0] == false) + { + LeaveHome(); + } + } + + private void panStatus_Click(object sender, EventArgs e) + { + if (this.menuSelected[1] == false) + { + SelectStatus(); + } + } + + private void panStatus_MouseHover(object sender, EventArgs e) + { + if (this.menuSelected[1] == false) + { + HoverStatus(); + } + + } + + private void panStatus_MouseLeave(object sender, EventArgs e) + { + if (this.menuSelected[1] == false) + { + LeaveStatus(); + } + } + } +} \ No newline at end of file diff --git a/RbFreqStandMeasure/Program.cs b/RbFreqStandMeasure/Program.cs index 0e902ab..93a83e5 100644 --- a/RbFreqStandMeasure/Program.cs +++ b/RbFreqStandMeasure/Program.cs @@ -15,7 +15,8 @@ { Application.EnableVisualStyles(); Application.SetCompatibleTextRenderingDefault(false); - Application.Run(new RbFreqStandMeasureForm()); + // Application.Run(new RbFreqStandMeasureForm()); + Application.Run(new RbFreqStdMeas()); } } } diff --git a/RbFreqStandMeasure/Properties/Resources.Designer.cs b/RbFreqStandMeasure/Properties/Resources.Designer.cs index 716ac6d..253d7d7 100644 --- a/RbFreqStandMeasure/Properties/Resources.Designer.cs +++ b/RbFreqStandMeasure/Properties/Resources.Designer.cs @@ -63,11 +63,71 @@ /// /// 查找 System.Drawing.Bitmap 类型的本地化资源。 /// + internal static System.Drawing.Bitmap bg_banner { + get { + object obj = ResourceManager.GetObject("bg_banner", resourceCulture); + return ((System.Drawing.Bitmap)(obj)); + } + } + + /// + /// 查找 System.Drawing.Bitmap 类型的本地化资源。 + /// internal static System.Drawing.Bitmap bg_white_shadow { get { object obj = ResourceManager.GetObject("bg_white_shadow", resourceCulture); return ((System.Drawing.Bitmap)(obj)); } } + + /// + /// 查找 System.Drawing.Bitmap 类型的本地化资源。 + /// + internal static System.Drawing.Bitmap icon_exit { + get { + object obj = ResourceManager.GetObject("icon_exit", resourceCulture); + return ((System.Drawing.Bitmap)(obj)); + } + } + + /// + /// 查找 System.Drawing.Bitmap 类型的本地化资源。 + /// + internal static System.Drawing.Bitmap icon_home { + get { + object obj = ResourceManager.GetObject("icon_home", resourceCulture); + return ((System.Drawing.Bitmap)(obj)); + } + } + + /// + /// 查找 System.Drawing.Bitmap 类型的本地化资源。 + /// + internal static System.Drawing.Bitmap icon_home_selected { + get { + object obj = ResourceManager.GetObject("icon_home_selected", resourceCulture); + return ((System.Drawing.Bitmap)(obj)); + } + } + + /// + /// 查找 System.Drawing.Bitmap 类型的本地化资源。 + /// + internal static System.Drawing.Bitmap icon_status { + get { + object obj = ResourceManager.GetObject("icon_status", resourceCulture); + return ((System.Drawing.Bitmap)(obj)); + } + } + + /// + /// 查找 System.Drawing.Bitmap 类型的本地化资源。 + /// + internal static System.Drawing.Bitmap icon_status_selected { + get { + object obj = ResourceManager.GetObject("icon_status_selected", resourceCulture); + return ((System.Drawing.Bitmap)(obj)); + } + } } } diff --git a/RbFreqStandMeasure/Properties/Resources.resx b/RbFreqStandMeasure/Properties/Resources.resx index 1435dab..e781bb7 100644 --- a/RbFreqStandMeasure/Properties/Resources.resx +++ b/RbFreqStandMeasure/Properties/Resources.resx @@ -118,7 +118,25 @@ System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + ..\res\images\icon_exit.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + ..\res\images\bg_white_shadow.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + ..\res\images\icon_home_selected.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + + ..\res\images\bg_banner.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + + ..\res\images\icon_home.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + + ..\res\images\icon_status.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + + ..\res\images\icon_status_selected.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + \ No newline at end of file diff --git a/RbFreqStandMeasure/RbFreqStandMeasure.csproj b/RbFreqStandMeasure/RbFreqStandMeasure.csproj index 35f244d..f5e7da9 100644 --- a/RbFreqStandMeasure/RbFreqStandMeasure.csproj +++ b/RbFreqStandMeasure/RbFreqStandMeasure.csproj @@ -126,6 +126,12 @@ + + Form + + + RbFreqStdMeas.cs + Component @@ -174,6 +180,9 @@ Resources.resx True + + RbFreqStdMeas.cs + SettingCtrlForm.cs @@ -205,6 +214,24 @@ + + + + + + + + + + + + + + + + + + diff --git a/RbFreqStandMeasure/RbFreqStdMeas.Designer.cs b/RbFreqStandMeasure/RbFreqStdMeas.Designer.cs new file mode 100644 index 0000000..57778cf --- /dev/null +++ b/RbFreqStandMeasure/RbFreqStdMeas.Designer.cs @@ -0,0 +1,248 @@ + +namespace Casic.Birmm.RbFreqStandMeasure +{ + partial class RbFreqStdMeas + { + /// + /// Required designer variable. + /// + private System.ComponentModel.IContainer components = null; + + /// + /// Clean up any resources being used. + /// + /// true if managed resources should be disposed; otherwise, false. + protected override void Dispose(bool disposing) + { + if (disposing && (components != null)) + { + components.Dispose(); + } + base.Dispose(disposing); + } + + #region Windows Form Designer generated code + + /// + /// Required method for Designer support - do not modify + /// the contents of this method with the code editor. + /// + private void InitializeComponent() + { + this.panMenu = new System.Windows.Forms.Panel(); + this.panStatus = new Casic.Birmm.RbFreqStandMeasure.RoundPanel(); + this.labStatusText = new System.Windows.Forms.Label(); + this.picIconStatus = new System.Windows.Forms.PictureBox(); + this.panHome = new Casic.Birmm.RbFreqStandMeasure.RoundPanel(); + this.labHomeText = new System.Windows.Forms.Label(); + this.picIconHome = new System.Windows.Forms.PictureBox(); + this.labHomeSelected = new System.Windows.Forms.Label(); + this.labStatusSelected = new System.Windows.Forms.Label(); + this.penBanner = new System.Windows.Forms.Panel(); + this.btnExitSys = new System.Windows.Forms.Button(); + this.labTitle = new System.Windows.Forms.Label(); + this.panMenu.SuspendLayout(); + this.panStatus.SuspendLayout(); + ((System.ComponentModel.ISupportInitialize)(this.picIconStatus)).BeginInit(); + this.panHome.SuspendLayout(); + ((System.ComponentModel.ISupportInitialize)(this.picIconHome)).BeginInit(); + this.penBanner.SuspendLayout(); + this.SuspendLayout(); + // + // panMenu + // + this.panMenu.BackColor = System.Drawing.Color.White; + this.panMenu.Controls.Add(this.panStatus); + this.panMenu.Controls.Add(this.panHome); + this.panMenu.Controls.Add(this.labStatusSelected); + this.panMenu.Location = new System.Drawing.Point(0, 64); + this.panMenu.Name = "panMenu"; + this.panMenu.Size = new System.Drawing.Size(1024, 50); + this.panMenu.TabIndex = 1; + // + // panStatus + // + this.panStatus.Back = System.Drawing.Color.Empty; + this.panStatus.BackColor = System.Drawing.Color.Transparent; + this.panStatus.Controls.Add(this.labStatusText); + this.panStatus.Controls.Add(this.picIconStatus); + this.panStatus.Location = new System.Drawing.Point(160, 0); + this.panStatus.MatrixRound = 8; + this.panStatus.Name = "panStatus"; + this.panStatus.Size = new System.Drawing.Size(130, 47); + this.panStatus.TabIndex = 1; + this.panStatus.Click += new System.EventHandler(this.panStatus_Click); + this.panStatus.MouseLeave += new System.EventHandler(this.panStatus_MouseLeave); + this.panStatus.MouseHover += new System.EventHandler(this.panStatus_MouseHover); + // + // labStatusText + // + this.labStatusText.BackColor = System.Drawing.Color.Transparent; + this.labStatusText.Cursor = System.Windows.Forms.Cursors.Hand; + this.labStatusText.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); + this.labStatusText.ForeColor = System.Drawing.SystemColors.ControlText; + this.labStatusText.Location = new System.Drawing.Point(35, 0); + this.labStatusText.Margin = new System.Windows.Forms.Padding(0); + this.labStatusText.Name = "labStatusText"; + this.labStatusText.Size = new System.Drawing.Size(85, 47); + this.labStatusText.TabIndex = 2; + this.labStatusText.Text = "基准状态"; + this.labStatusText.TextAlign = System.Drawing.ContentAlignment.MiddleRight; + this.labStatusText.Click += new System.EventHandler(this.panStatus_Click); + this.labStatusText.MouseLeave += new System.EventHandler(this.panStatus_MouseLeave); + this.labStatusText.MouseHover += new System.EventHandler(this.panStatus_MouseHover); + // + // picIconStatus + // + this.picIconStatus.BackgroundImage = global::Casic.Birmm.RbFreqStandMeasure.Properties.Resources.icon_status; + this.picIconStatus.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Zoom; + this.picIconStatus.Location = new System.Drawing.Point(10, 11); + this.picIconStatus.Name = "picIconStatus"; + this.picIconStatus.Size = new System.Drawing.Size(25, 25); + this.picIconStatus.TabIndex = 1; + this.picIconStatus.TabStop = false; + this.picIconStatus.Click += new System.EventHandler(this.panStatus_Click); + this.picIconStatus.MouseLeave += new System.EventHandler(this.panStatus_MouseLeave); + this.picIconStatus.MouseHover += new System.EventHandler(this.panStatus_MouseHover); + // + // panHome + // + this.panHome.Back = System.Drawing.Color.Empty; + this.panHome.Controls.Add(this.labHomeText); + this.panHome.Controls.Add(this.picIconHome); + this.panHome.Controls.Add(this.labHomeSelected); + this.panHome.Cursor = System.Windows.Forms.Cursors.Hand; + this.panHome.Location = new System.Drawing.Point(30, 0); + this.panHome.MatrixRound = 8; + this.panHome.Name = "panHome"; + this.panHome.Size = new System.Drawing.Size(100, 50); + this.panHome.TabIndex = 0; + this.panHome.Click += new System.EventHandler(this.panHome_Click); + this.panHome.MouseLeave += new System.EventHandler(this.panHome_MouseLeave); + this.panHome.MouseHover += new System.EventHandler(this.panHome_MouseHover); + // + // labHomeText + // + this.labHomeText.BackColor = System.Drawing.Color.Transparent; + this.labHomeText.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); + this.labHomeText.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(18)))), ((int)(((byte)(150)))), ((int)(((byte)(219))))); + this.labHomeText.Location = new System.Drawing.Point(35, 0); + this.labHomeText.Margin = new System.Windows.Forms.Padding(0); + this.labHomeText.Name = "labHomeText"; + this.labHomeText.Size = new System.Drawing.Size(55, 47); + this.labHomeText.TabIndex = 2; + this.labHomeText.Text = "首页"; + this.labHomeText.TextAlign = System.Drawing.ContentAlignment.MiddleRight; + this.labHomeText.Click += new System.EventHandler(this.panHome_Click); + this.labHomeText.MouseLeave += new System.EventHandler(this.panHome_MouseLeave); + this.labHomeText.MouseHover += new System.EventHandler(this.panHome_MouseHover); + // + // picIconHome + // + this.picIconHome.BackColor = System.Drawing.Color.Transparent; + this.picIconHome.BackgroundImage = global::Casic.Birmm.RbFreqStandMeasure.Properties.Resources.icon_home_selected; + this.picIconHome.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Zoom; + this.picIconHome.Location = new System.Drawing.Point(10, 11); + this.picIconHome.Name = "picIconHome"; + this.picIconHome.Size = new System.Drawing.Size(25, 25); + this.picIconHome.TabIndex = 1; + this.picIconHome.TabStop = false; + this.picIconHome.Click += new System.EventHandler(this.panHome_Click); + this.picIconHome.MouseLeave += new System.EventHandler(this.panHome_MouseLeave); + this.picIconHome.MouseHover += new System.EventHandler(this.panHome_MouseHover); + // + // labHomeSelected + // + this.labHomeSelected.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(18)))), ((int)(((byte)(150)))), ((int)(((byte)(219))))); + this.labHomeSelected.Location = new System.Drawing.Point(0, 47); + this.labHomeSelected.Name = "labHomeSelected"; + this.labHomeSelected.Size = new System.Drawing.Size(100, 3); + this.labHomeSelected.TabIndex = 0; + // + // labStatusSelected + // + this.labStatusSelected.BackColor = System.Drawing.Color.Transparent; + this.labStatusSelected.Location = new System.Drawing.Point(160, 47); + this.labStatusSelected.Margin = new System.Windows.Forms.Padding(0); + this.labStatusSelected.Name = "labStatusSelected"; + this.labStatusSelected.Size = new System.Drawing.Size(130, 3); + this.labStatusSelected.TabIndex = 0; + // + // penBanner + // + this.penBanner.BackgroundImage = global::Casic.Birmm.RbFreqStandMeasure.Properties.Resources.bg_banner; + this.penBanner.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Stretch; + this.penBanner.Controls.Add(this.btnExitSys); + this.penBanner.Controls.Add(this.labTitle); + this.penBanner.Location = new System.Drawing.Point(0, 0); + this.penBanner.Name = "penBanner"; + this.penBanner.Size = new System.Drawing.Size(1024, 64); + this.penBanner.TabIndex = 0; + this.penBanner.MouseDown += new System.Windows.Forms.MouseEventHandler(this.RbFreqStdMeas_MouseDown); + // + // btnExitSys + // + this.btnExitSys.BackColor = System.Drawing.Color.Transparent; + this.btnExitSys.BackgroundImage = global::Casic.Birmm.RbFreqStandMeasure.Properties.Resources.icon_exit; + this.btnExitSys.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Stretch; + this.btnExitSys.FlatAppearance.BorderSize = 0; + this.btnExitSys.FlatStyle = System.Windows.Forms.FlatStyle.Flat; + this.btnExitSys.ForeColor = System.Drawing.SystemColors.ControlDarkDark; + this.btnExitSys.Location = new System.Drawing.Point(974, 22); + this.btnExitSys.Margin = new System.Windows.Forms.Padding(0); + this.btnExitSys.Name = "btnExitSys"; + this.btnExitSys.Size = new System.Drawing.Size(20, 20); + this.btnExitSys.TabIndex = 1; + this.btnExitSys.UseVisualStyleBackColor = false; + this.btnExitSys.Click += new System.EventHandler(this.btnExitSys_Click); + this.btnExitSys.MouseHover += new System.EventHandler(this.btnExitSys_MouseHover); + // + // labTitle + // + this.labTitle.BackColor = System.Drawing.Color.Transparent; + this.labTitle.Font = new System.Drawing.Font("微软雅黑", 15.75F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(134))); + this.labTitle.ForeColor = System.Drawing.Color.White; + this.labTitle.Location = new System.Drawing.Point(30, 16); + this.labTitle.Name = "labTitle"; + this.labTitle.Size = new System.Drawing.Size(300, 32); + this.labTitle.TabIndex = 0; + this.labTitle.Text = "铷原子频标比对测量软件"; + this.labTitle.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; + // + // RbFreqStdMeas + // + this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.ClientSize = new System.Drawing.Size(1024, 768); + this.Controls.Add(this.panMenu); + this.Controls.Add(this.penBanner); + this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.None; + this.Name = "RbFreqStdMeas"; + this.Text = "RbFreqStdMeas"; + this.Load += new System.EventHandler(this.RbFreqStdMeas_Load); + this.panMenu.ResumeLayout(false); + this.panStatus.ResumeLayout(false); + ((System.ComponentModel.ISupportInitialize)(this.picIconStatus)).EndInit(); + this.panHome.ResumeLayout(false); + ((System.ComponentModel.ISupportInitialize)(this.picIconHome)).EndInit(); + this.penBanner.ResumeLayout(false); + this.ResumeLayout(false); + + } + + #endregion + + private System.Windows.Forms.Panel penBanner; + private System.Windows.Forms.Label labTitle; + private System.Windows.Forms.Button btnExitSys; + private System.Windows.Forms.Panel panMenu; + private System.Windows.Forms.Label labHomeSelected; + private System.Windows.Forms.PictureBox picIconHome; + private System.Windows.Forms.Label labHomeText; + private System.Windows.Forms.Label labStatusText; + private System.Windows.Forms.PictureBox picIconStatus; + private RoundPanel panStatus; + private RoundPanel panHome; + private System.Windows.Forms.Label labStatusSelected; + } +} \ No newline at end of file diff --git a/RbFreqStandMeasure/RbFreqStdMeas.cs b/RbFreqStandMeasure/RbFreqStdMeas.cs new file mode 100644 index 0000000..3858ddb --- /dev/null +++ b/RbFreqStandMeasure/RbFreqStdMeas.cs @@ -0,0 +1,195 @@ +using Casic.Birmm.RbFreqStandMeasure.Properties; +using System; +using System.Collections.Generic; +using System.ComponentModel; +using System.Data; +using System.Drawing; +using System.Linq; +using System.Resources; +using System.Runtime.InteropServices; +using System.Text; +using System.Windows.Forms; + +namespace Casic.Birmm.RbFreqStandMeasure +{ + public partial class RbFreqStdMeas : Form + { + + #region 无边框拖动效果 + [DllImport("user32.dll")]//拖动无窗体的控件 + public static extern bool ReleaseCapture(); + [DllImport("user32.dll")] + public static extern bool SendMessage(IntPtr hwnd, int wMsg, int wParam, int lParam); + public const int WM_SYSCOMMAND = 0x0112; + public const int SC_MOVE = 0xF010; + public const int HTCAPTION = 0x0002; + + private void RbFreqStdMeas_MouseDown(object sender, MouseEventArgs e) + { + //拖动窗体 + ReleaseCapture(); + SendMessage(this.Handle, WM_SYSCOMMAND, SC_MOVE + HTCAPTION, 0); + } + #endregion + + private bool[] menuSelected = { true, false }; + // 按钮图标 + private PictureBox[] menuPics; + // 按钮图标的资源名称(选中的资源名称在后面加上 _selected) + private string[] menuIconResources; + // 按钮文本 + private Label[] menuLabels; + // 按钮下划线 + private Label[] menuUnderlines; + + private void ClearAllMenuSelected() + { + // 找到当前选中的按钮 + int index = 0; + for (int i = 0; i < this.menuSelected.Length; i++) + { + if (this.menuSelected[i] == true) + { + index = i; + break; + } + } + + // 将当前按钮的效果设置为默认未选中 + this.menuPics[index].BackgroundImage = (Bitmap)Resources.ResourceManager.GetObject(this.menuIconResources[index], null); + this.menuLabels[index].ForeColor = ColorTranslator.FromHtml("#2C2C2C"); + this.menuUnderlines[index].BackColor = Color.Transparent; + } + + #region 首页按钮点击、鼠标移入/移出效果 + private void HoverHome() + { + panHome.Back = ColorTranslator.FromHtml("#56a3f2"); + } + private void LeaveHome() + { + panHome.Back = Color.Transparent; + } + private void SelectHome() + { + // 移除所有按钮的选中样式 + this.ClearAllMenuSelected(); + + // 鼠标移入效果去掉 + LeaveHome(); + + // 重新设置所有按钮的状态 + this.menuSelected = new bool[] { true, false }; + + // 将新选中的按钮设置为选中 + this.picIconHome.BackgroundImage = (Bitmap)Resources.ResourceManager.GetObject("icon_home_selected", null); + this.labHomeText.ForeColor = ColorTranslator.FromHtml("#1296db"); + this.labHomeSelected.BackColor = ColorTranslator.FromHtml("#1296db"); + + } + #endregion + + #region 基准状态按钮点击、移入/移出效果 + private void HoverStatus() + { + panStatus.Back = ColorTranslator.FromHtml("#56a3f2"); + } + private void LeaveStatus() + { + panStatus.Back = Color.Transparent; + } + private void SelectStatus() + { + // 移除所有按钮的选中样式 + this.ClearAllMenuSelected(); + + // 鼠标移入效果去掉 + LeaveStatus(); + + // 重新设置所有按钮的状态 + this.menuSelected = new bool[] { false, true }; + + // 将新选中的按钮设置为选中 + this.picIconStatus.BackgroundImage = (Bitmap) Resources.ResourceManager.GetObject("icon_status_selected", null); + this.labStatusText.ForeColor = ColorTranslator.FromHtml("#1296db"); + this.labStatusSelected.BackColor = ColorTranslator.FromHtml("#1296db"); + } + #endregion + + public RbFreqStdMeas() + { + InitializeComponent(); + } + + private void RbFreqStdMeas_Load(object sender, EventArgs e) + { + this.menuPics = new PictureBox[] { this.picIconHome, this.picIconStatus }; + this.menuLabels = new Label[] { this.labHomeText, this.labStatusText }; + this.menuUnderlines = new Label[] { this.labHomeSelected, this.labStatusSelected }; + this.menuIconResources = new string[] { "icon_home", "icon_status" }; + } + + private void btnExitSys_Click(object sender, EventArgs e) + { + Application.Exit(); + } + + private void btnExitSys_MouseHover(object sender, EventArgs e) + { + ToolTip p = new ToolTip(); + p.ShowAlways = true; + p.SetToolTip(this.btnExitSys, "退出"); + } + + private void panHome_Click(object sender, EventArgs e) + { + if (this.menuSelected[0] == false) + { + this.SelectHome(); + } + } + + private void panHome_MouseHover(object sender, EventArgs e) + { + // 没有选中首页时才动作 + if (this.menuSelected[0] == false) + { + HoverHome(); + } + } + + private void panHome_MouseLeave(object sender, EventArgs e) + { + // 没有选中首页时才动作 + if (this.menuSelected[0] == false) + { + LeaveHome(); + } + } + + private void panStatus_Click(object sender, EventArgs e) + { + if (this.menuSelected[1] == false) + { + SelectStatus(); + } + } + + private void panStatus_MouseHover(object sender, EventArgs e) + { + if (this.menuSelected[1] == false) + { + HoverStatus(); + } + + } + + private void panStatus_MouseLeave(object sender, EventArgs e) + { + if (this.menuSelected[1] == false) + { + LeaveStatus(); + } + } + } +} \ No newline at end of file diff --git a/RbFreqStandMeasure/RbFreqStdMeas.resx b/RbFreqStandMeasure/RbFreqStdMeas.resx new file mode 100644 index 0000000..1af7de1 --- /dev/null +++ b/RbFreqStandMeasure/RbFreqStdMeas.resx @@ -0,0 +1,120 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + \ No newline at end of file diff --git a/RbFreqStandMeasure/Program.cs b/RbFreqStandMeasure/Program.cs index 0e902ab..93a83e5 100644 --- a/RbFreqStandMeasure/Program.cs +++ b/RbFreqStandMeasure/Program.cs @@ -15,7 +15,8 @@ { Application.EnableVisualStyles(); Application.SetCompatibleTextRenderingDefault(false); - Application.Run(new RbFreqStandMeasureForm()); + // Application.Run(new RbFreqStandMeasureForm()); + Application.Run(new RbFreqStdMeas()); } } } diff --git a/RbFreqStandMeasure/Properties/Resources.Designer.cs b/RbFreqStandMeasure/Properties/Resources.Designer.cs index 716ac6d..253d7d7 100644 --- a/RbFreqStandMeasure/Properties/Resources.Designer.cs +++ b/RbFreqStandMeasure/Properties/Resources.Designer.cs @@ -63,11 +63,71 @@ /// /// 查找 System.Drawing.Bitmap 类型的本地化资源。 /// + internal static System.Drawing.Bitmap bg_banner { + get { + object obj = ResourceManager.GetObject("bg_banner", resourceCulture); + return ((System.Drawing.Bitmap)(obj)); + } + } + + /// + /// 查找 System.Drawing.Bitmap 类型的本地化资源。 + /// internal static System.Drawing.Bitmap bg_white_shadow { get { object obj = ResourceManager.GetObject("bg_white_shadow", resourceCulture); return ((System.Drawing.Bitmap)(obj)); } } + + /// + /// 查找 System.Drawing.Bitmap 类型的本地化资源。 + /// + internal static System.Drawing.Bitmap icon_exit { + get { + object obj = ResourceManager.GetObject("icon_exit", resourceCulture); + return ((System.Drawing.Bitmap)(obj)); + } + } + + /// + /// 查找 System.Drawing.Bitmap 类型的本地化资源。 + /// + internal static System.Drawing.Bitmap icon_home { + get { + object obj = ResourceManager.GetObject("icon_home", resourceCulture); + return ((System.Drawing.Bitmap)(obj)); + } + } + + /// + /// 查找 System.Drawing.Bitmap 类型的本地化资源。 + /// + internal static System.Drawing.Bitmap icon_home_selected { + get { + object obj = ResourceManager.GetObject("icon_home_selected", resourceCulture); + return ((System.Drawing.Bitmap)(obj)); + } + } + + /// + /// 查找 System.Drawing.Bitmap 类型的本地化资源。 + /// + internal static System.Drawing.Bitmap icon_status { + get { + object obj = ResourceManager.GetObject("icon_status", resourceCulture); + return ((System.Drawing.Bitmap)(obj)); + } + } + + /// + /// 查找 System.Drawing.Bitmap 类型的本地化资源。 + /// + internal static System.Drawing.Bitmap icon_status_selected { + get { + object obj = ResourceManager.GetObject("icon_status_selected", resourceCulture); + return ((System.Drawing.Bitmap)(obj)); + } + } } } diff --git a/RbFreqStandMeasure/Properties/Resources.resx b/RbFreqStandMeasure/Properties/Resources.resx index 1435dab..e781bb7 100644 --- a/RbFreqStandMeasure/Properties/Resources.resx +++ b/RbFreqStandMeasure/Properties/Resources.resx @@ -118,7 +118,25 @@ System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + ..\res\images\icon_exit.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + ..\res\images\bg_white_shadow.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + ..\res\images\icon_home_selected.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + + ..\res\images\bg_banner.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + + ..\res\images\icon_home.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + + ..\res\images\icon_status.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + + ..\res\images\icon_status_selected.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + \ No newline at end of file diff --git a/RbFreqStandMeasure/RbFreqStandMeasure.csproj b/RbFreqStandMeasure/RbFreqStandMeasure.csproj index 35f244d..f5e7da9 100644 --- a/RbFreqStandMeasure/RbFreqStandMeasure.csproj +++ b/RbFreqStandMeasure/RbFreqStandMeasure.csproj @@ -126,6 +126,12 @@ + + Form + + + RbFreqStdMeas.cs + Component @@ -174,6 +180,9 @@ Resources.resx True + + RbFreqStdMeas.cs + SettingCtrlForm.cs @@ -205,6 +214,24 @@ + + + + + + + + + + + + + + + + + + diff --git a/RbFreqStandMeasure/RbFreqStdMeas.Designer.cs b/RbFreqStandMeasure/RbFreqStdMeas.Designer.cs new file mode 100644 index 0000000..57778cf --- /dev/null +++ b/RbFreqStandMeasure/RbFreqStdMeas.Designer.cs @@ -0,0 +1,248 @@ + +namespace Casic.Birmm.RbFreqStandMeasure +{ + partial class RbFreqStdMeas + { + /// + /// Required designer variable. + /// + private System.ComponentModel.IContainer components = null; + + /// + /// Clean up any resources being used. + /// + /// true if managed resources should be disposed; otherwise, false. + protected override void Dispose(bool disposing) + { + if (disposing && (components != null)) + { + components.Dispose(); + } + base.Dispose(disposing); + } + + #region Windows Form Designer generated code + + /// + /// Required method for Designer support - do not modify + /// the contents of this method with the code editor. + /// + private void InitializeComponent() + { + this.panMenu = new System.Windows.Forms.Panel(); + this.panStatus = new Casic.Birmm.RbFreqStandMeasure.RoundPanel(); + this.labStatusText = new System.Windows.Forms.Label(); + this.picIconStatus = new System.Windows.Forms.PictureBox(); + this.panHome = new Casic.Birmm.RbFreqStandMeasure.RoundPanel(); + this.labHomeText = new System.Windows.Forms.Label(); + this.picIconHome = new System.Windows.Forms.PictureBox(); + this.labHomeSelected = new System.Windows.Forms.Label(); + this.labStatusSelected = new System.Windows.Forms.Label(); + this.penBanner = new System.Windows.Forms.Panel(); + this.btnExitSys = new System.Windows.Forms.Button(); + this.labTitle = new System.Windows.Forms.Label(); + this.panMenu.SuspendLayout(); + this.panStatus.SuspendLayout(); + ((System.ComponentModel.ISupportInitialize)(this.picIconStatus)).BeginInit(); + this.panHome.SuspendLayout(); + ((System.ComponentModel.ISupportInitialize)(this.picIconHome)).BeginInit(); + this.penBanner.SuspendLayout(); + this.SuspendLayout(); + // + // panMenu + // + this.panMenu.BackColor = System.Drawing.Color.White; + this.panMenu.Controls.Add(this.panStatus); + this.panMenu.Controls.Add(this.panHome); + this.panMenu.Controls.Add(this.labStatusSelected); + this.panMenu.Location = new System.Drawing.Point(0, 64); + this.panMenu.Name = "panMenu"; + this.panMenu.Size = new System.Drawing.Size(1024, 50); + this.panMenu.TabIndex = 1; + // + // panStatus + // + this.panStatus.Back = System.Drawing.Color.Empty; + this.panStatus.BackColor = System.Drawing.Color.Transparent; + this.panStatus.Controls.Add(this.labStatusText); + this.panStatus.Controls.Add(this.picIconStatus); + this.panStatus.Location = new System.Drawing.Point(160, 0); + this.panStatus.MatrixRound = 8; + this.panStatus.Name = "panStatus"; + this.panStatus.Size = new System.Drawing.Size(130, 47); + this.panStatus.TabIndex = 1; + this.panStatus.Click += new System.EventHandler(this.panStatus_Click); + this.panStatus.MouseLeave += new System.EventHandler(this.panStatus_MouseLeave); + this.panStatus.MouseHover += new System.EventHandler(this.panStatus_MouseHover); + // + // labStatusText + // + this.labStatusText.BackColor = System.Drawing.Color.Transparent; + this.labStatusText.Cursor = System.Windows.Forms.Cursors.Hand; + this.labStatusText.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); + this.labStatusText.ForeColor = System.Drawing.SystemColors.ControlText; + this.labStatusText.Location = new System.Drawing.Point(35, 0); + this.labStatusText.Margin = new System.Windows.Forms.Padding(0); + this.labStatusText.Name = "labStatusText"; + this.labStatusText.Size = new System.Drawing.Size(85, 47); + this.labStatusText.TabIndex = 2; + this.labStatusText.Text = "基准状态"; + this.labStatusText.TextAlign = System.Drawing.ContentAlignment.MiddleRight; + this.labStatusText.Click += new System.EventHandler(this.panStatus_Click); + this.labStatusText.MouseLeave += new System.EventHandler(this.panStatus_MouseLeave); + this.labStatusText.MouseHover += new System.EventHandler(this.panStatus_MouseHover); + // + // picIconStatus + // + this.picIconStatus.BackgroundImage = global::Casic.Birmm.RbFreqStandMeasure.Properties.Resources.icon_status; + this.picIconStatus.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Zoom; + this.picIconStatus.Location = new System.Drawing.Point(10, 11); + this.picIconStatus.Name = "picIconStatus"; + this.picIconStatus.Size = new System.Drawing.Size(25, 25); + this.picIconStatus.TabIndex = 1; + this.picIconStatus.TabStop = false; + this.picIconStatus.Click += new System.EventHandler(this.panStatus_Click); + this.picIconStatus.MouseLeave += new System.EventHandler(this.panStatus_MouseLeave); + this.picIconStatus.MouseHover += new System.EventHandler(this.panStatus_MouseHover); + // + // panHome + // + this.panHome.Back = System.Drawing.Color.Empty; + this.panHome.Controls.Add(this.labHomeText); + this.panHome.Controls.Add(this.picIconHome); + this.panHome.Controls.Add(this.labHomeSelected); + this.panHome.Cursor = System.Windows.Forms.Cursors.Hand; + this.panHome.Location = new System.Drawing.Point(30, 0); + this.panHome.MatrixRound = 8; + this.panHome.Name = "panHome"; + this.panHome.Size = new System.Drawing.Size(100, 50); + this.panHome.TabIndex = 0; + this.panHome.Click += new System.EventHandler(this.panHome_Click); + this.panHome.MouseLeave += new System.EventHandler(this.panHome_MouseLeave); + this.panHome.MouseHover += new System.EventHandler(this.panHome_MouseHover); + // + // labHomeText + // + this.labHomeText.BackColor = System.Drawing.Color.Transparent; + this.labHomeText.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); + this.labHomeText.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(18)))), ((int)(((byte)(150)))), ((int)(((byte)(219))))); + this.labHomeText.Location = new System.Drawing.Point(35, 0); + this.labHomeText.Margin = new System.Windows.Forms.Padding(0); + this.labHomeText.Name = "labHomeText"; + this.labHomeText.Size = new System.Drawing.Size(55, 47); + this.labHomeText.TabIndex = 2; + this.labHomeText.Text = "首页"; + this.labHomeText.TextAlign = System.Drawing.ContentAlignment.MiddleRight; + this.labHomeText.Click += new System.EventHandler(this.panHome_Click); + this.labHomeText.MouseLeave += new System.EventHandler(this.panHome_MouseLeave); + this.labHomeText.MouseHover += new System.EventHandler(this.panHome_MouseHover); + // + // picIconHome + // + this.picIconHome.BackColor = System.Drawing.Color.Transparent; + this.picIconHome.BackgroundImage = global::Casic.Birmm.RbFreqStandMeasure.Properties.Resources.icon_home_selected; + this.picIconHome.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Zoom; + this.picIconHome.Location = new System.Drawing.Point(10, 11); + this.picIconHome.Name = "picIconHome"; + this.picIconHome.Size = new System.Drawing.Size(25, 25); + this.picIconHome.TabIndex = 1; + this.picIconHome.TabStop = false; + this.picIconHome.Click += new System.EventHandler(this.panHome_Click); + this.picIconHome.MouseLeave += new System.EventHandler(this.panHome_MouseLeave); + this.picIconHome.MouseHover += new System.EventHandler(this.panHome_MouseHover); + // + // labHomeSelected + // + this.labHomeSelected.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(18)))), ((int)(((byte)(150)))), ((int)(((byte)(219))))); + this.labHomeSelected.Location = new System.Drawing.Point(0, 47); + this.labHomeSelected.Name = "labHomeSelected"; + this.labHomeSelected.Size = new System.Drawing.Size(100, 3); + this.labHomeSelected.TabIndex = 0; + // + // labStatusSelected + // + this.labStatusSelected.BackColor = System.Drawing.Color.Transparent; + this.labStatusSelected.Location = new System.Drawing.Point(160, 47); + this.labStatusSelected.Margin = new System.Windows.Forms.Padding(0); + this.labStatusSelected.Name = "labStatusSelected"; + this.labStatusSelected.Size = new System.Drawing.Size(130, 3); + this.labStatusSelected.TabIndex = 0; + // + // penBanner + // + this.penBanner.BackgroundImage = global::Casic.Birmm.RbFreqStandMeasure.Properties.Resources.bg_banner; + this.penBanner.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Stretch; + this.penBanner.Controls.Add(this.btnExitSys); + this.penBanner.Controls.Add(this.labTitle); + this.penBanner.Location = new System.Drawing.Point(0, 0); + this.penBanner.Name = "penBanner"; + this.penBanner.Size = new System.Drawing.Size(1024, 64); + this.penBanner.TabIndex = 0; + this.penBanner.MouseDown += new System.Windows.Forms.MouseEventHandler(this.RbFreqStdMeas_MouseDown); + // + // btnExitSys + // + this.btnExitSys.BackColor = System.Drawing.Color.Transparent; + this.btnExitSys.BackgroundImage = global::Casic.Birmm.RbFreqStandMeasure.Properties.Resources.icon_exit; + this.btnExitSys.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Stretch; + this.btnExitSys.FlatAppearance.BorderSize = 0; + this.btnExitSys.FlatStyle = System.Windows.Forms.FlatStyle.Flat; + this.btnExitSys.ForeColor = System.Drawing.SystemColors.ControlDarkDark; + this.btnExitSys.Location = new System.Drawing.Point(974, 22); + this.btnExitSys.Margin = new System.Windows.Forms.Padding(0); + this.btnExitSys.Name = "btnExitSys"; + this.btnExitSys.Size = new System.Drawing.Size(20, 20); + this.btnExitSys.TabIndex = 1; + this.btnExitSys.UseVisualStyleBackColor = false; + this.btnExitSys.Click += new System.EventHandler(this.btnExitSys_Click); + this.btnExitSys.MouseHover += new System.EventHandler(this.btnExitSys_MouseHover); + // + // labTitle + // + this.labTitle.BackColor = System.Drawing.Color.Transparent; + this.labTitle.Font = new System.Drawing.Font("微软雅黑", 15.75F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(134))); + this.labTitle.ForeColor = System.Drawing.Color.White; + this.labTitle.Location = new System.Drawing.Point(30, 16); + this.labTitle.Name = "labTitle"; + this.labTitle.Size = new System.Drawing.Size(300, 32); + this.labTitle.TabIndex = 0; + this.labTitle.Text = "铷原子频标比对测量软件"; + this.labTitle.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; + // + // RbFreqStdMeas + // + this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.ClientSize = new System.Drawing.Size(1024, 768); + this.Controls.Add(this.panMenu); + this.Controls.Add(this.penBanner); + this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.None; + this.Name = "RbFreqStdMeas"; + this.Text = "RbFreqStdMeas"; + this.Load += new System.EventHandler(this.RbFreqStdMeas_Load); + this.panMenu.ResumeLayout(false); + this.panStatus.ResumeLayout(false); + ((System.ComponentModel.ISupportInitialize)(this.picIconStatus)).EndInit(); + this.panHome.ResumeLayout(false); + ((System.ComponentModel.ISupportInitialize)(this.picIconHome)).EndInit(); + this.penBanner.ResumeLayout(false); + this.ResumeLayout(false); + + } + + #endregion + + private System.Windows.Forms.Panel penBanner; + private System.Windows.Forms.Label labTitle; + private System.Windows.Forms.Button btnExitSys; + private System.Windows.Forms.Panel panMenu; + private System.Windows.Forms.Label labHomeSelected; + private System.Windows.Forms.PictureBox picIconHome; + private System.Windows.Forms.Label labHomeText; + private System.Windows.Forms.Label labStatusText; + private System.Windows.Forms.PictureBox picIconStatus; + private RoundPanel panStatus; + private RoundPanel panHome; + private System.Windows.Forms.Label labStatusSelected; + } +} \ No newline at end of file diff --git a/RbFreqStandMeasure/RbFreqStdMeas.cs b/RbFreqStandMeasure/RbFreqStdMeas.cs new file mode 100644 index 0000000..3858ddb --- /dev/null +++ b/RbFreqStandMeasure/RbFreqStdMeas.cs @@ -0,0 +1,195 @@ +using Casic.Birmm.RbFreqStandMeasure.Properties; +using System; +using System.Collections.Generic; +using System.ComponentModel; +using System.Data; +using System.Drawing; +using System.Linq; +using System.Resources; +using System.Runtime.InteropServices; +using System.Text; +using System.Windows.Forms; + +namespace Casic.Birmm.RbFreqStandMeasure +{ + public partial class RbFreqStdMeas : Form + { + + #region 无边框拖动效果 + [DllImport("user32.dll")]//拖动无窗体的控件 + public static extern bool ReleaseCapture(); + [DllImport("user32.dll")] + public static extern bool SendMessage(IntPtr hwnd, int wMsg, int wParam, int lParam); + public const int WM_SYSCOMMAND = 0x0112; + public const int SC_MOVE = 0xF010; + public const int HTCAPTION = 0x0002; + + private void RbFreqStdMeas_MouseDown(object sender, MouseEventArgs e) + { + //拖动窗体 + ReleaseCapture(); + SendMessage(this.Handle, WM_SYSCOMMAND, SC_MOVE + HTCAPTION, 0); + } + #endregion + + private bool[] menuSelected = { true, false }; + // 按钮图标 + private PictureBox[] menuPics; + // 按钮图标的资源名称(选中的资源名称在后面加上 _selected) + private string[] menuIconResources; + // 按钮文本 + private Label[] menuLabels; + // 按钮下划线 + private Label[] menuUnderlines; + + private void ClearAllMenuSelected() + { + // 找到当前选中的按钮 + int index = 0; + for (int i = 0; i < this.menuSelected.Length; i++) + { + if (this.menuSelected[i] == true) + { + index = i; + break; + } + } + + // 将当前按钮的效果设置为默认未选中 + this.menuPics[index].BackgroundImage = (Bitmap)Resources.ResourceManager.GetObject(this.menuIconResources[index], null); + this.menuLabels[index].ForeColor = ColorTranslator.FromHtml("#2C2C2C"); + this.menuUnderlines[index].BackColor = Color.Transparent; + } + + #region 首页按钮点击、鼠标移入/移出效果 + private void HoverHome() + { + panHome.Back = ColorTranslator.FromHtml("#56a3f2"); + } + private void LeaveHome() + { + panHome.Back = Color.Transparent; + } + private void SelectHome() + { + // 移除所有按钮的选中样式 + this.ClearAllMenuSelected(); + + // 鼠标移入效果去掉 + LeaveHome(); + + // 重新设置所有按钮的状态 + this.menuSelected = new bool[] { true, false }; + + // 将新选中的按钮设置为选中 + this.picIconHome.BackgroundImage = (Bitmap)Resources.ResourceManager.GetObject("icon_home_selected", null); + this.labHomeText.ForeColor = ColorTranslator.FromHtml("#1296db"); + this.labHomeSelected.BackColor = ColorTranslator.FromHtml("#1296db"); + + } + #endregion + + #region 基准状态按钮点击、移入/移出效果 + private void HoverStatus() + { + panStatus.Back = ColorTranslator.FromHtml("#56a3f2"); + } + private void LeaveStatus() + { + panStatus.Back = Color.Transparent; + } + private void SelectStatus() + { + // 移除所有按钮的选中样式 + this.ClearAllMenuSelected(); + + // 鼠标移入效果去掉 + LeaveStatus(); + + // 重新设置所有按钮的状态 + this.menuSelected = new bool[] { false, true }; + + // 将新选中的按钮设置为选中 + this.picIconStatus.BackgroundImage = (Bitmap) Resources.ResourceManager.GetObject("icon_status_selected", null); + this.labStatusText.ForeColor = ColorTranslator.FromHtml("#1296db"); + this.labStatusSelected.BackColor = ColorTranslator.FromHtml("#1296db"); + } + #endregion + + public RbFreqStdMeas() + { + InitializeComponent(); + } + + private void RbFreqStdMeas_Load(object sender, EventArgs e) + { + this.menuPics = new PictureBox[] { this.picIconHome, this.picIconStatus }; + this.menuLabels = new Label[] { this.labHomeText, this.labStatusText }; + this.menuUnderlines = new Label[] { this.labHomeSelected, this.labStatusSelected }; + this.menuIconResources = new string[] { "icon_home", "icon_status" }; + } + + private void btnExitSys_Click(object sender, EventArgs e) + { + Application.Exit(); + } + + private void btnExitSys_MouseHover(object sender, EventArgs e) + { + ToolTip p = new ToolTip(); + p.ShowAlways = true; + p.SetToolTip(this.btnExitSys, "退出"); + } + + private void panHome_Click(object sender, EventArgs e) + { + if (this.menuSelected[0] == false) + { + this.SelectHome(); + } + } + + private void panHome_MouseHover(object sender, EventArgs e) + { + // 没有选中首页时才动作 + if (this.menuSelected[0] == false) + { + HoverHome(); + } + } + + private void panHome_MouseLeave(object sender, EventArgs e) + { + // 没有选中首页时才动作 + if (this.menuSelected[0] == false) + { + LeaveHome(); + } + } + + private void panStatus_Click(object sender, EventArgs e) + { + if (this.menuSelected[1] == false) + { + SelectStatus(); + } + } + + private void panStatus_MouseHover(object sender, EventArgs e) + { + if (this.menuSelected[1] == false) + { + HoverStatus(); + } + + } + + private void panStatus_MouseLeave(object sender, EventArgs e) + { + if (this.menuSelected[1] == false) + { + LeaveStatus(); + } + } + } +} \ No newline at end of file diff --git a/RbFreqStandMeasure/RbFreqStdMeas.resx b/RbFreqStandMeasure/RbFreqStdMeas.resx new file mode 100644 index 0000000..1af7de1 --- /dev/null +++ b/RbFreqStandMeasure/RbFreqStdMeas.resx @@ -0,0 +1,120 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + \ No newline at end of file diff --git a/RbFreqStandMeasure/res/images/bg_banner.png b/RbFreqStandMeasure/res/images/bg_banner.png new file mode 100644 index 0000000..d795b7d --- /dev/null +++ b/RbFreqStandMeasure/res/images/bg_banner.png Binary files differ diff --git a/RbFreqStandMeasure/Program.cs b/RbFreqStandMeasure/Program.cs index 0e902ab..93a83e5 100644 --- a/RbFreqStandMeasure/Program.cs +++ b/RbFreqStandMeasure/Program.cs @@ -15,7 +15,8 @@ { Application.EnableVisualStyles(); Application.SetCompatibleTextRenderingDefault(false); - Application.Run(new RbFreqStandMeasureForm()); + // Application.Run(new RbFreqStandMeasureForm()); + Application.Run(new RbFreqStdMeas()); } } } diff --git a/RbFreqStandMeasure/Properties/Resources.Designer.cs b/RbFreqStandMeasure/Properties/Resources.Designer.cs index 716ac6d..253d7d7 100644 --- a/RbFreqStandMeasure/Properties/Resources.Designer.cs +++ b/RbFreqStandMeasure/Properties/Resources.Designer.cs @@ -63,11 +63,71 @@ /// /// 查找 System.Drawing.Bitmap 类型的本地化资源。 /// + internal static System.Drawing.Bitmap bg_banner { + get { + object obj = ResourceManager.GetObject("bg_banner", resourceCulture); + return ((System.Drawing.Bitmap)(obj)); + } + } + + /// + /// 查找 System.Drawing.Bitmap 类型的本地化资源。 + /// internal static System.Drawing.Bitmap bg_white_shadow { get { object obj = ResourceManager.GetObject("bg_white_shadow", resourceCulture); return ((System.Drawing.Bitmap)(obj)); } } + + /// + /// 查找 System.Drawing.Bitmap 类型的本地化资源。 + /// + internal static System.Drawing.Bitmap icon_exit { + get { + object obj = ResourceManager.GetObject("icon_exit", resourceCulture); + return ((System.Drawing.Bitmap)(obj)); + } + } + + /// + /// 查找 System.Drawing.Bitmap 类型的本地化资源。 + /// + internal static System.Drawing.Bitmap icon_home { + get { + object obj = ResourceManager.GetObject("icon_home", resourceCulture); + return ((System.Drawing.Bitmap)(obj)); + } + } + + /// + /// 查找 System.Drawing.Bitmap 类型的本地化资源。 + /// + internal static System.Drawing.Bitmap icon_home_selected { + get { + object obj = ResourceManager.GetObject("icon_home_selected", resourceCulture); + return ((System.Drawing.Bitmap)(obj)); + } + } + + /// + /// 查找 System.Drawing.Bitmap 类型的本地化资源。 + /// + internal static System.Drawing.Bitmap icon_status { + get { + object obj = ResourceManager.GetObject("icon_status", resourceCulture); + return ((System.Drawing.Bitmap)(obj)); + } + } + + /// + /// 查找 System.Drawing.Bitmap 类型的本地化资源。 + /// + internal static System.Drawing.Bitmap icon_status_selected { + get { + object obj = ResourceManager.GetObject("icon_status_selected", resourceCulture); + return ((System.Drawing.Bitmap)(obj)); + } + } } } diff --git a/RbFreqStandMeasure/Properties/Resources.resx b/RbFreqStandMeasure/Properties/Resources.resx index 1435dab..e781bb7 100644 --- a/RbFreqStandMeasure/Properties/Resources.resx +++ b/RbFreqStandMeasure/Properties/Resources.resx @@ -118,7 +118,25 @@ System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + ..\res\images\icon_exit.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + ..\res\images\bg_white_shadow.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + ..\res\images\icon_home_selected.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + + ..\res\images\bg_banner.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + + ..\res\images\icon_home.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + + ..\res\images\icon_status.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + + ..\res\images\icon_status_selected.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + \ No newline at end of file diff --git a/RbFreqStandMeasure/RbFreqStandMeasure.csproj b/RbFreqStandMeasure/RbFreqStandMeasure.csproj index 35f244d..f5e7da9 100644 --- a/RbFreqStandMeasure/RbFreqStandMeasure.csproj +++ b/RbFreqStandMeasure/RbFreqStandMeasure.csproj @@ -126,6 +126,12 @@ + + Form + + + RbFreqStdMeas.cs + Component @@ -174,6 +180,9 @@ Resources.resx True + + RbFreqStdMeas.cs + SettingCtrlForm.cs @@ -205,6 +214,24 @@ + + + + + + + + + + + + + + + + + + diff --git a/RbFreqStandMeasure/RbFreqStdMeas.Designer.cs b/RbFreqStandMeasure/RbFreqStdMeas.Designer.cs new file mode 100644 index 0000000..57778cf --- /dev/null +++ b/RbFreqStandMeasure/RbFreqStdMeas.Designer.cs @@ -0,0 +1,248 @@ + +namespace Casic.Birmm.RbFreqStandMeasure +{ + partial class RbFreqStdMeas + { + /// + /// Required designer variable. + /// + private System.ComponentModel.IContainer components = null; + + /// + /// Clean up any resources being used. + /// + /// true if managed resources should be disposed; otherwise, false. + protected override void Dispose(bool disposing) + { + if (disposing && (components != null)) + { + components.Dispose(); + } + base.Dispose(disposing); + } + + #region Windows Form Designer generated code + + /// + /// Required method for Designer support - do not modify + /// the contents of this method with the code editor. + /// + private void InitializeComponent() + { + this.panMenu = new System.Windows.Forms.Panel(); + this.panStatus = new Casic.Birmm.RbFreqStandMeasure.RoundPanel(); + this.labStatusText = new System.Windows.Forms.Label(); + this.picIconStatus = new System.Windows.Forms.PictureBox(); + this.panHome = new Casic.Birmm.RbFreqStandMeasure.RoundPanel(); + this.labHomeText = new System.Windows.Forms.Label(); + this.picIconHome = new System.Windows.Forms.PictureBox(); + this.labHomeSelected = new System.Windows.Forms.Label(); + this.labStatusSelected = new System.Windows.Forms.Label(); + this.penBanner = new System.Windows.Forms.Panel(); + this.btnExitSys = new System.Windows.Forms.Button(); + this.labTitle = new System.Windows.Forms.Label(); + this.panMenu.SuspendLayout(); + this.panStatus.SuspendLayout(); + ((System.ComponentModel.ISupportInitialize)(this.picIconStatus)).BeginInit(); + this.panHome.SuspendLayout(); + ((System.ComponentModel.ISupportInitialize)(this.picIconHome)).BeginInit(); + this.penBanner.SuspendLayout(); + this.SuspendLayout(); + // + // panMenu + // + this.panMenu.BackColor = System.Drawing.Color.White; + this.panMenu.Controls.Add(this.panStatus); + this.panMenu.Controls.Add(this.panHome); + this.panMenu.Controls.Add(this.labStatusSelected); + this.panMenu.Location = new System.Drawing.Point(0, 64); + this.panMenu.Name = "panMenu"; + this.panMenu.Size = new System.Drawing.Size(1024, 50); + this.panMenu.TabIndex = 1; + // + // panStatus + // + this.panStatus.Back = System.Drawing.Color.Empty; + this.panStatus.BackColor = System.Drawing.Color.Transparent; + this.panStatus.Controls.Add(this.labStatusText); + this.panStatus.Controls.Add(this.picIconStatus); + this.panStatus.Location = new System.Drawing.Point(160, 0); + this.panStatus.MatrixRound = 8; + this.panStatus.Name = "panStatus"; + this.panStatus.Size = new System.Drawing.Size(130, 47); + this.panStatus.TabIndex = 1; + this.panStatus.Click += new System.EventHandler(this.panStatus_Click); + this.panStatus.MouseLeave += new System.EventHandler(this.panStatus_MouseLeave); + this.panStatus.MouseHover += new System.EventHandler(this.panStatus_MouseHover); + // + // labStatusText + // + this.labStatusText.BackColor = System.Drawing.Color.Transparent; + this.labStatusText.Cursor = System.Windows.Forms.Cursors.Hand; + this.labStatusText.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); + this.labStatusText.ForeColor = System.Drawing.SystemColors.ControlText; + this.labStatusText.Location = new System.Drawing.Point(35, 0); + this.labStatusText.Margin = new System.Windows.Forms.Padding(0); + this.labStatusText.Name = "labStatusText"; + this.labStatusText.Size = new System.Drawing.Size(85, 47); + this.labStatusText.TabIndex = 2; + this.labStatusText.Text = "基准状态"; + this.labStatusText.TextAlign = System.Drawing.ContentAlignment.MiddleRight; + this.labStatusText.Click += new System.EventHandler(this.panStatus_Click); + this.labStatusText.MouseLeave += new System.EventHandler(this.panStatus_MouseLeave); + this.labStatusText.MouseHover += new System.EventHandler(this.panStatus_MouseHover); + // + // picIconStatus + // + this.picIconStatus.BackgroundImage = global::Casic.Birmm.RbFreqStandMeasure.Properties.Resources.icon_status; + this.picIconStatus.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Zoom; + this.picIconStatus.Location = new System.Drawing.Point(10, 11); + this.picIconStatus.Name = "picIconStatus"; + this.picIconStatus.Size = new System.Drawing.Size(25, 25); + this.picIconStatus.TabIndex = 1; + this.picIconStatus.TabStop = false; + this.picIconStatus.Click += new System.EventHandler(this.panStatus_Click); + this.picIconStatus.MouseLeave += new System.EventHandler(this.panStatus_MouseLeave); + this.picIconStatus.MouseHover += new System.EventHandler(this.panStatus_MouseHover); + // + // panHome + // + this.panHome.Back = System.Drawing.Color.Empty; + this.panHome.Controls.Add(this.labHomeText); + this.panHome.Controls.Add(this.picIconHome); + this.panHome.Controls.Add(this.labHomeSelected); + this.panHome.Cursor = System.Windows.Forms.Cursors.Hand; + this.panHome.Location = new System.Drawing.Point(30, 0); + this.panHome.MatrixRound = 8; + this.panHome.Name = "panHome"; + this.panHome.Size = new System.Drawing.Size(100, 50); + this.panHome.TabIndex = 0; + this.panHome.Click += new System.EventHandler(this.panHome_Click); + this.panHome.MouseLeave += new System.EventHandler(this.panHome_MouseLeave); + this.panHome.MouseHover += new System.EventHandler(this.panHome_MouseHover); + // + // labHomeText + // + this.labHomeText.BackColor = System.Drawing.Color.Transparent; + this.labHomeText.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); + this.labHomeText.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(18)))), ((int)(((byte)(150)))), ((int)(((byte)(219))))); + this.labHomeText.Location = new System.Drawing.Point(35, 0); + this.labHomeText.Margin = new System.Windows.Forms.Padding(0); + this.labHomeText.Name = "labHomeText"; + this.labHomeText.Size = new System.Drawing.Size(55, 47); + this.labHomeText.TabIndex = 2; + this.labHomeText.Text = "首页"; + this.labHomeText.TextAlign = System.Drawing.ContentAlignment.MiddleRight; + this.labHomeText.Click += new System.EventHandler(this.panHome_Click); + this.labHomeText.MouseLeave += new System.EventHandler(this.panHome_MouseLeave); + this.labHomeText.MouseHover += new System.EventHandler(this.panHome_MouseHover); + // + // picIconHome + // + this.picIconHome.BackColor = System.Drawing.Color.Transparent; + this.picIconHome.BackgroundImage = global::Casic.Birmm.RbFreqStandMeasure.Properties.Resources.icon_home_selected; + this.picIconHome.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Zoom; + this.picIconHome.Location = new System.Drawing.Point(10, 11); + this.picIconHome.Name = "picIconHome"; + this.picIconHome.Size = new System.Drawing.Size(25, 25); + this.picIconHome.TabIndex = 1; + this.picIconHome.TabStop = false; + this.picIconHome.Click += new System.EventHandler(this.panHome_Click); + this.picIconHome.MouseLeave += new System.EventHandler(this.panHome_MouseLeave); + this.picIconHome.MouseHover += new System.EventHandler(this.panHome_MouseHover); + // + // labHomeSelected + // + this.labHomeSelected.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(18)))), ((int)(((byte)(150)))), ((int)(((byte)(219))))); + this.labHomeSelected.Location = new System.Drawing.Point(0, 47); + this.labHomeSelected.Name = "labHomeSelected"; + this.labHomeSelected.Size = new System.Drawing.Size(100, 3); + this.labHomeSelected.TabIndex = 0; + // + // labStatusSelected + // + this.labStatusSelected.BackColor = System.Drawing.Color.Transparent; + this.labStatusSelected.Location = new System.Drawing.Point(160, 47); + this.labStatusSelected.Margin = new System.Windows.Forms.Padding(0); + this.labStatusSelected.Name = "labStatusSelected"; + this.labStatusSelected.Size = new System.Drawing.Size(130, 3); + this.labStatusSelected.TabIndex = 0; + // + // penBanner + // + this.penBanner.BackgroundImage = global::Casic.Birmm.RbFreqStandMeasure.Properties.Resources.bg_banner; + this.penBanner.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Stretch; + this.penBanner.Controls.Add(this.btnExitSys); + this.penBanner.Controls.Add(this.labTitle); + this.penBanner.Location = new System.Drawing.Point(0, 0); + this.penBanner.Name = "penBanner"; + this.penBanner.Size = new System.Drawing.Size(1024, 64); + this.penBanner.TabIndex = 0; + this.penBanner.MouseDown += new System.Windows.Forms.MouseEventHandler(this.RbFreqStdMeas_MouseDown); + // + // btnExitSys + // + this.btnExitSys.BackColor = System.Drawing.Color.Transparent; + this.btnExitSys.BackgroundImage = global::Casic.Birmm.RbFreqStandMeasure.Properties.Resources.icon_exit; + this.btnExitSys.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Stretch; + this.btnExitSys.FlatAppearance.BorderSize = 0; + this.btnExitSys.FlatStyle = System.Windows.Forms.FlatStyle.Flat; + this.btnExitSys.ForeColor = System.Drawing.SystemColors.ControlDarkDark; + this.btnExitSys.Location = new System.Drawing.Point(974, 22); + this.btnExitSys.Margin = new System.Windows.Forms.Padding(0); + this.btnExitSys.Name = "btnExitSys"; + this.btnExitSys.Size = new System.Drawing.Size(20, 20); + this.btnExitSys.TabIndex = 1; + this.btnExitSys.UseVisualStyleBackColor = false; + this.btnExitSys.Click += new System.EventHandler(this.btnExitSys_Click); + this.btnExitSys.MouseHover += new System.EventHandler(this.btnExitSys_MouseHover); + // + // labTitle + // + this.labTitle.BackColor = System.Drawing.Color.Transparent; + this.labTitle.Font = new System.Drawing.Font("微软雅黑", 15.75F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(134))); + this.labTitle.ForeColor = System.Drawing.Color.White; + this.labTitle.Location = new System.Drawing.Point(30, 16); + this.labTitle.Name = "labTitle"; + this.labTitle.Size = new System.Drawing.Size(300, 32); + this.labTitle.TabIndex = 0; + this.labTitle.Text = "铷原子频标比对测量软件"; + this.labTitle.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; + // + // RbFreqStdMeas + // + this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.ClientSize = new System.Drawing.Size(1024, 768); + this.Controls.Add(this.panMenu); + this.Controls.Add(this.penBanner); + this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.None; + this.Name = "RbFreqStdMeas"; + this.Text = "RbFreqStdMeas"; + this.Load += new System.EventHandler(this.RbFreqStdMeas_Load); + this.panMenu.ResumeLayout(false); + this.panStatus.ResumeLayout(false); + ((System.ComponentModel.ISupportInitialize)(this.picIconStatus)).EndInit(); + this.panHome.ResumeLayout(false); + ((System.ComponentModel.ISupportInitialize)(this.picIconHome)).EndInit(); + this.penBanner.ResumeLayout(false); + this.ResumeLayout(false); + + } + + #endregion + + private System.Windows.Forms.Panel penBanner; + private System.Windows.Forms.Label labTitle; + private System.Windows.Forms.Button btnExitSys; + private System.Windows.Forms.Panel panMenu; + private System.Windows.Forms.Label labHomeSelected; + private System.Windows.Forms.PictureBox picIconHome; + private System.Windows.Forms.Label labHomeText; + private System.Windows.Forms.Label labStatusText; + private System.Windows.Forms.PictureBox picIconStatus; + private RoundPanel panStatus; + private RoundPanel panHome; + private System.Windows.Forms.Label labStatusSelected; + } +} \ No newline at end of file diff --git a/RbFreqStandMeasure/RbFreqStdMeas.cs b/RbFreqStandMeasure/RbFreqStdMeas.cs new file mode 100644 index 0000000..3858ddb --- /dev/null +++ b/RbFreqStandMeasure/RbFreqStdMeas.cs @@ -0,0 +1,195 @@ +using Casic.Birmm.RbFreqStandMeasure.Properties; +using System; +using System.Collections.Generic; +using System.ComponentModel; +using System.Data; +using System.Drawing; +using System.Linq; +using System.Resources; +using System.Runtime.InteropServices; +using System.Text; +using System.Windows.Forms; + +namespace Casic.Birmm.RbFreqStandMeasure +{ + public partial class RbFreqStdMeas : Form + { + + #region 无边框拖动效果 + [DllImport("user32.dll")]//拖动无窗体的控件 + public static extern bool ReleaseCapture(); + [DllImport("user32.dll")] + public static extern bool SendMessage(IntPtr hwnd, int wMsg, int wParam, int lParam); + public const int WM_SYSCOMMAND = 0x0112; + public const int SC_MOVE = 0xF010; + public const int HTCAPTION = 0x0002; + + private void RbFreqStdMeas_MouseDown(object sender, MouseEventArgs e) + { + //拖动窗体 + ReleaseCapture(); + SendMessage(this.Handle, WM_SYSCOMMAND, SC_MOVE + HTCAPTION, 0); + } + #endregion + + private bool[] menuSelected = { true, false }; + // 按钮图标 + private PictureBox[] menuPics; + // 按钮图标的资源名称(选中的资源名称在后面加上 _selected) + private string[] menuIconResources; + // 按钮文本 + private Label[] menuLabels; + // 按钮下划线 + private Label[] menuUnderlines; + + private void ClearAllMenuSelected() + { + // 找到当前选中的按钮 + int index = 0; + for (int i = 0; i < this.menuSelected.Length; i++) + { + if (this.menuSelected[i] == true) + { + index = i; + break; + } + } + + // 将当前按钮的效果设置为默认未选中 + this.menuPics[index].BackgroundImage = (Bitmap)Resources.ResourceManager.GetObject(this.menuIconResources[index], null); + this.menuLabels[index].ForeColor = ColorTranslator.FromHtml("#2C2C2C"); + this.menuUnderlines[index].BackColor = Color.Transparent; + } + + #region 首页按钮点击、鼠标移入/移出效果 + private void HoverHome() + { + panHome.Back = ColorTranslator.FromHtml("#56a3f2"); + } + private void LeaveHome() + { + panHome.Back = Color.Transparent; + } + private void SelectHome() + { + // 移除所有按钮的选中样式 + this.ClearAllMenuSelected(); + + // 鼠标移入效果去掉 + LeaveHome(); + + // 重新设置所有按钮的状态 + this.menuSelected = new bool[] { true, false }; + + // 将新选中的按钮设置为选中 + this.picIconHome.BackgroundImage = (Bitmap)Resources.ResourceManager.GetObject("icon_home_selected", null); + this.labHomeText.ForeColor = ColorTranslator.FromHtml("#1296db"); + this.labHomeSelected.BackColor = ColorTranslator.FromHtml("#1296db"); + + } + #endregion + + #region 基准状态按钮点击、移入/移出效果 + private void HoverStatus() + { + panStatus.Back = ColorTranslator.FromHtml("#56a3f2"); + } + private void LeaveStatus() + { + panStatus.Back = Color.Transparent; + } + private void SelectStatus() + { + // 移除所有按钮的选中样式 + this.ClearAllMenuSelected(); + + // 鼠标移入效果去掉 + LeaveStatus(); + + // 重新设置所有按钮的状态 + this.menuSelected = new bool[] { false, true }; + + // 将新选中的按钮设置为选中 + this.picIconStatus.BackgroundImage = (Bitmap) Resources.ResourceManager.GetObject("icon_status_selected", null); + this.labStatusText.ForeColor = ColorTranslator.FromHtml("#1296db"); + this.labStatusSelected.BackColor = ColorTranslator.FromHtml("#1296db"); + } + #endregion + + public RbFreqStdMeas() + { + InitializeComponent(); + } + + private void RbFreqStdMeas_Load(object sender, EventArgs e) + { + this.menuPics = new PictureBox[] { this.picIconHome, this.picIconStatus }; + this.menuLabels = new Label[] { this.labHomeText, this.labStatusText }; + this.menuUnderlines = new Label[] { this.labHomeSelected, this.labStatusSelected }; + this.menuIconResources = new string[] { "icon_home", "icon_status" }; + } + + private void btnExitSys_Click(object sender, EventArgs e) + { + Application.Exit(); + } + + private void btnExitSys_MouseHover(object sender, EventArgs e) + { + ToolTip p = new ToolTip(); + p.ShowAlways = true; + p.SetToolTip(this.btnExitSys, "退出"); + } + + private void panHome_Click(object sender, EventArgs e) + { + if (this.menuSelected[0] == false) + { + this.SelectHome(); + } + } + + private void panHome_MouseHover(object sender, EventArgs e) + { + // 没有选中首页时才动作 + if (this.menuSelected[0] == false) + { + HoverHome(); + } + } + + private void panHome_MouseLeave(object sender, EventArgs e) + { + // 没有选中首页时才动作 + if (this.menuSelected[0] == false) + { + LeaveHome(); + } + } + + private void panStatus_Click(object sender, EventArgs e) + { + if (this.menuSelected[1] == false) + { + SelectStatus(); + } + } + + private void panStatus_MouseHover(object sender, EventArgs e) + { + if (this.menuSelected[1] == false) + { + HoverStatus(); + } + + } + + private void panStatus_MouseLeave(object sender, EventArgs e) + { + if (this.menuSelected[1] == false) + { + LeaveStatus(); + } + } + } +} \ No newline at end of file diff --git a/RbFreqStandMeasure/RbFreqStdMeas.resx b/RbFreqStandMeasure/RbFreqStdMeas.resx new file mode 100644 index 0000000..1af7de1 --- /dev/null +++ b/RbFreqStandMeasure/RbFreqStdMeas.resx @@ -0,0 +1,120 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + \ No newline at end of file diff --git a/RbFreqStandMeasure/res/images/bg_banner.png b/RbFreqStandMeasure/res/images/bg_banner.png new file mode 100644 index 0000000..d795b7d --- /dev/null +++ b/RbFreqStandMeasure/res/images/bg_banner.png Binary files differ diff --git a/RbFreqStandMeasure/res/images/icon_exit.png b/RbFreqStandMeasure/res/images/icon_exit.png new file mode 100644 index 0000000..997b9e9 --- /dev/null +++ b/RbFreqStandMeasure/res/images/icon_exit.png Binary files differ diff --git a/RbFreqStandMeasure/Program.cs b/RbFreqStandMeasure/Program.cs index 0e902ab..93a83e5 100644 --- a/RbFreqStandMeasure/Program.cs +++ b/RbFreqStandMeasure/Program.cs @@ -15,7 +15,8 @@ { Application.EnableVisualStyles(); Application.SetCompatibleTextRenderingDefault(false); - Application.Run(new RbFreqStandMeasureForm()); + // Application.Run(new RbFreqStandMeasureForm()); + Application.Run(new RbFreqStdMeas()); } } } diff --git a/RbFreqStandMeasure/Properties/Resources.Designer.cs b/RbFreqStandMeasure/Properties/Resources.Designer.cs index 716ac6d..253d7d7 100644 --- a/RbFreqStandMeasure/Properties/Resources.Designer.cs +++ b/RbFreqStandMeasure/Properties/Resources.Designer.cs @@ -63,11 +63,71 @@ /// /// 查找 System.Drawing.Bitmap 类型的本地化资源。 /// + internal static System.Drawing.Bitmap bg_banner { + get { + object obj = ResourceManager.GetObject("bg_banner", resourceCulture); + return ((System.Drawing.Bitmap)(obj)); + } + } + + /// + /// 查找 System.Drawing.Bitmap 类型的本地化资源。 + /// internal static System.Drawing.Bitmap bg_white_shadow { get { object obj = ResourceManager.GetObject("bg_white_shadow", resourceCulture); return ((System.Drawing.Bitmap)(obj)); } } + + /// + /// 查找 System.Drawing.Bitmap 类型的本地化资源。 + /// + internal static System.Drawing.Bitmap icon_exit { + get { + object obj = ResourceManager.GetObject("icon_exit", resourceCulture); + return ((System.Drawing.Bitmap)(obj)); + } + } + + /// + /// 查找 System.Drawing.Bitmap 类型的本地化资源。 + /// + internal static System.Drawing.Bitmap icon_home { + get { + object obj = ResourceManager.GetObject("icon_home", resourceCulture); + return ((System.Drawing.Bitmap)(obj)); + } + } + + /// + /// 查找 System.Drawing.Bitmap 类型的本地化资源。 + /// + internal static System.Drawing.Bitmap icon_home_selected { + get { + object obj = ResourceManager.GetObject("icon_home_selected", resourceCulture); + return ((System.Drawing.Bitmap)(obj)); + } + } + + /// + /// 查找 System.Drawing.Bitmap 类型的本地化资源。 + /// + internal static System.Drawing.Bitmap icon_status { + get { + object obj = ResourceManager.GetObject("icon_status", resourceCulture); + return ((System.Drawing.Bitmap)(obj)); + } + } + + /// + /// 查找 System.Drawing.Bitmap 类型的本地化资源。 + /// + internal static System.Drawing.Bitmap icon_status_selected { + get { + object obj = ResourceManager.GetObject("icon_status_selected", resourceCulture); + return ((System.Drawing.Bitmap)(obj)); + } + } } } diff --git a/RbFreqStandMeasure/Properties/Resources.resx b/RbFreqStandMeasure/Properties/Resources.resx index 1435dab..e781bb7 100644 --- a/RbFreqStandMeasure/Properties/Resources.resx +++ b/RbFreqStandMeasure/Properties/Resources.resx @@ -118,7 +118,25 @@ System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + ..\res\images\icon_exit.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + ..\res\images\bg_white_shadow.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + ..\res\images\icon_home_selected.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + + ..\res\images\bg_banner.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + + ..\res\images\icon_home.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + + ..\res\images\icon_status.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + + ..\res\images\icon_status_selected.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + \ No newline at end of file diff --git a/RbFreqStandMeasure/RbFreqStandMeasure.csproj b/RbFreqStandMeasure/RbFreqStandMeasure.csproj index 35f244d..f5e7da9 100644 --- a/RbFreqStandMeasure/RbFreqStandMeasure.csproj +++ b/RbFreqStandMeasure/RbFreqStandMeasure.csproj @@ -126,6 +126,12 @@ + + Form + + + RbFreqStdMeas.cs + Component @@ -174,6 +180,9 @@ Resources.resx True + + RbFreqStdMeas.cs + SettingCtrlForm.cs @@ -205,6 +214,24 @@ + + + + + + + + + + + + + + + + + + diff --git a/RbFreqStandMeasure/RbFreqStdMeas.Designer.cs b/RbFreqStandMeasure/RbFreqStdMeas.Designer.cs new file mode 100644 index 0000000..57778cf --- /dev/null +++ b/RbFreqStandMeasure/RbFreqStdMeas.Designer.cs @@ -0,0 +1,248 @@ + +namespace Casic.Birmm.RbFreqStandMeasure +{ + partial class RbFreqStdMeas + { + /// + /// Required designer variable. + /// + private System.ComponentModel.IContainer components = null; + + /// + /// Clean up any resources being used. + /// + /// true if managed resources should be disposed; otherwise, false. + protected override void Dispose(bool disposing) + { + if (disposing && (components != null)) + { + components.Dispose(); + } + base.Dispose(disposing); + } + + #region Windows Form Designer generated code + + /// + /// Required method for Designer support - do not modify + /// the contents of this method with the code editor. + /// + private void InitializeComponent() + { + this.panMenu = new System.Windows.Forms.Panel(); + this.panStatus = new Casic.Birmm.RbFreqStandMeasure.RoundPanel(); + this.labStatusText = new System.Windows.Forms.Label(); + this.picIconStatus = new System.Windows.Forms.PictureBox(); + this.panHome = new Casic.Birmm.RbFreqStandMeasure.RoundPanel(); + this.labHomeText = new System.Windows.Forms.Label(); + this.picIconHome = new System.Windows.Forms.PictureBox(); + this.labHomeSelected = new System.Windows.Forms.Label(); + this.labStatusSelected = new System.Windows.Forms.Label(); + this.penBanner = new System.Windows.Forms.Panel(); + this.btnExitSys = new System.Windows.Forms.Button(); + this.labTitle = new System.Windows.Forms.Label(); + this.panMenu.SuspendLayout(); + this.panStatus.SuspendLayout(); + ((System.ComponentModel.ISupportInitialize)(this.picIconStatus)).BeginInit(); + this.panHome.SuspendLayout(); + ((System.ComponentModel.ISupportInitialize)(this.picIconHome)).BeginInit(); + this.penBanner.SuspendLayout(); + this.SuspendLayout(); + // + // panMenu + // + this.panMenu.BackColor = System.Drawing.Color.White; + this.panMenu.Controls.Add(this.panStatus); + this.panMenu.Controls.Add(this.panHome); + this.panMenu.Controls.Add(this.labStatusSelected); + this.panMenu.Location = new System.Drawing.Point(0, 64); + this.panMenu.Name = "panMenu"; + this.panMenu.Size = new System.Drawing.Size(1024, 50); + this.panMenu.TabIndex = 1; + // + // panStatus + // + this.panStatus.Back = System.Drawing.Color.Empty; + this.panStatus.BackColor = System.Drawing.Color.Transparent; + this.panStatus.Controls.Add(this.labStatusText); + this.panStatus.Controls.Add(this.picIconStatus); + this.panStatus.Location = new System.Drawing.Point(160, 0); + this.panStatus.MatrixRound = 8; + this.panStatus.Name = "panStatus"; + this.panStatus.Size = new System.Drawing.Size(130, 47); + this.panStatus.TabIndex = 1; + this.panStatus.Click += new System.EventHandler(this.panStatus_Click); + this.panStatus.MouseLeave += new System.EventHandler(this.panStatus_MouseLeave); + this.panStatus.MouseHover += new System.EventHandler(this.panStatus_MouseHover); + // + // labStatusText + // + this.labStatusText.BackColor = System.Drawing.Color.Transparent; + this.labStatusText.Cursor = System.Windows.Forms.Cursors.Hand; + this.labStatusText.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); + this.labStatusText.ForeColor = System.Drawing.SystemColors.ControlText; + this.labStatusText.Location = new System.Drawing.Point(35, 0); + this.labStatusText.Margin = new System.Windows.Forms.Padding(0); + this.labStatusText.Name = "labStatusText"; + this.labStatusText.Size = new System.Drawing.Size(85, 47); + this.labStatusText.TabIndex = 2; + this.labStatusText.Text = "基准状态"; + this.labStatusText.TextAlign = System.Drawing.ContentAlignment.MiddleRight; + this.labStatusText.Click += new System.EventHandler(this.panStatus_Click); + this.labStatusText.MouseLeave += new System.EventHandler(this.panStatus_MouseLeave); + this.labStatusText.MouseHover += new System.EventHandler(this.panStatus_MouseHover); + // + // picIconStatus + // + this.picIconStatus.BackgroundImage = global::Casic.Birmm.RbFreqStandMeasure.Properties.Resources.icon_status; + this.picIconStatus.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Zoom; + this.picIconStatus.Location = new System.Drawing.Point(10, 11); + this.picIconStatus.Name = "picIconStatus"; + this.picIconStatus.Size = new System.Drawing.Size(25, 25); + this.picIconStatus.TabIndex = 1; + this.picIconStatus.TabStop = false; + this.picIconStatus.Click += new System.EventHandler(this.panStatus_Click); + this.picIconStatus.MouseLeave += new System.EventHandler(this.panStatus_MouseLeave); + this.picIconStatus.MouseHover += new System.EventHandler(this.panStatus_MouseHover); + // + // panHome + // + this.panHome.Back = System.Drawing.Color.Empty; + this.panHome.Controls.Add(this.labHomeText); + this.panHome.Controls.Add(this.picIconHome); + this.panHome.Controls.Add(this.labHomeSelected); + this.panHome.Cursor = System.Windows.Forms.Cursors.Hand; + this.panHome.Location = new System.Drawing.Point(30, 0); + this.panHome.MatrixRound = 8; + this.panHome.Name = "panHome"; + this.panHome.Size = new System.Drawing.Size(100, 50); + this.panHome.TabIndex = 0; + this.panHome.Click += new System.EventHandler(this.panHome_Click); + this.panHome.MouseLeave += new System.EventHandler(this.panHome_MouseLeave); + this.panHome.MouseHover += new System.EventHandler(this.panHome_MouseHover); + // + // labHomeText + // + this.labHomeText.BackColor = System.Drawing.Color.Transparent; + this.labHomeText.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); + this.labHomeText.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(18)))), ((int)(((byte)(150)))), ((int)(((byte)(219))))); + this.labHomeText.Location = new System.Drawing.Point(35, 0); + this.labHomeText.Margin = new System.Windows.Forms.Padding(0); + this.labHomeText.Name = "labHomeText"; + this.labHomeText.Size = new System.Drawing.Size(55, 47); + this.labHomeText.TabIndex = 2; + this.labHomeText.Text = "首页"; + this.labHomeText.TextAlign = System.Drawing.ContentAlignment.MiddleRight; + this.labHomeText.Click += new System.EventHandler(this.panHome_Click); + this.labHomeText.MouseLeave += new System.EventHandler(this.panHome_MouseLeave); + this.labHomeText.MouseHover += new System.EventHandler(this.panHome_MouseHover); + // + // picIconHome + // + this.picIconHome.BackColor = System.Drawing.Color.Transparent; + this.picIconHome.BackgroundImage = global::Casic.Birmm.RbFreqStandMeasure.Properties.Resources.icon_home_selected; + this.picIconHome.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Zoom; + this.picIconHome.Location = new System.Drawing.Point(10, 11); + this.picIconHome.Name = "picIconHome"; + this.picIconHome.Size = new System.Drawing.Size(25, 25); + this.picIconHome.TabIndex = 1; + this.picIconHome.TabStop = false; + this.picIconHome.Click += new System.EventHandler(this.panHome_Click); + this.picIconHome.MouseLeave += new System.EventHandler(this.panHome_MouseLeave); + this.picIconHome.MouseHover += new System.EventHandler(this.panHome_MouseHover); + // + // labHomeSelected + // + this.labHomeSelected.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(18)))), ((int)(((byte)(150)))), ((int)(((byte)(219))))); + this.labHomeSelected.Location = new System.Drawing.Point(0, 47); + this.labHomeSelected.Name = "labHomeSelected"; + this.labHomeSelected.Size = new System.Drawing.Size(100, 3); + this.labHomeSelected.TabIndex = 0; + // + // labStatusSelected + // + this.labStatusSelected.BackColor = System.Drawing.Color.Transparent; + this.labStatusSelected.Location = new System.Drawing.Point(160, 47); + this.labStatusSelected.Margin = new System.Windows.Forms.Padding(0); + this.labStatusSelected.Name = "labStatusSelected"; + this.labStatusSelected.Size = new System.Drawing.Size(130, 3); + this.labStatusSelected.TabIndex = 0; + // + // penBanner + // + this.penBanner.BackgroundImage = global::Casic.Birmm.RbFreqStandMeasure.Properties.Resources.bg_banner; + this.penBanner.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Stretch; + this.penBanner.Controls.Add(this.btnExitSys); + this.penBanner.Controls.Add(this.labTitle); + this.penBanner.Location = new System.Drawing.Point(0, 0); + this.penBanner.Name = "penBanner"; + this.penBanner.Size = new System.Drawing.Size(1024, 64); + this.penBanner.TabIndex = 0; + this.penBanner.MouseDown += new System.Windows.Forms.MouseEventHandler(this.RbFreqStdMeas_MouseDown); + // + // btnExitSys + // + this.btnExitSys.BackColor = System.Drawing.Color.Transparent; + this.btnExitSys.BackgroundImage = global::Casic.Birmm.RbFreqStandMeasure.Properties.Resources.icon_exit; + this.btnExitSys.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Stretch; + this.btnExitSys.FlatAppearance.BorderSize = 0; + this.btnExitSys.FlatStyle = System.Windows.Forms.FlatStyle.Flat; + this.btnExitSys.ForeColor = System.Drawing.SystemColors.ControlDarkDark; + this.btnExitSys.Location = new System.Drawing.Point(974, 22); + this.btnExitSys.Margin = new System.Windows.Forms.Padding(0); + this.btnExitSys.Name = "btnExitSys"; + this.btnExitSys.Size = new System.Drawing.Size(20, 20); + this.btnExitSys.TabIndex = 1; + this.btnExitSys.UseVisualStyleBackColor = false; + this.btnExitSys.Click += new System.EventHandler(this.btnExitSys_Click); + this.btnExitSys.MouseHover += new System.EventHandler(this.btnExitSys_MouseHover); + // + // labTitle + // + this.labTitle.BackColor = System.Drawing.Color.Transparent; + this.labTitle.Font = new System.Drawing.Font("微软雅黑", 15.75F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(134))); + this.labTitle.ForeColor = System.Drawing.Color.White; + this.labTitle.Location = new System.Drawing.Point(30, 16); + this.labTitle.Name = "labTitle"; + this.labTitle.Size = new System.Drawing.Size(300, 32); + this.labTitle.TabIndex = 0; + this.labTitle.Text = "铷原子频标比对测量软件"; + this.labTitle.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; + // + // RbFreqStdMeas + // + this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.ClientSize = new System.Drawing.Size(1024, 768); + this.Controls.Add(this.panMenu); + this.Controls.Add(this.penBanner); + this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.None; + this.Name = "RbFreqStdMeas"; + this.Text = "RbFreqStdMeas"; + this.Load += new System.EventHandler(this.RbFreqStdMeas_Load); + this.panMenu.ResumeLayout(false); + this.panStatus.ResumeLayout(false); + ((System.ComponentModel.ISupportInitialize)(this.picIconStatus)).EndInit(); + this.panHome.ResumeLayout(false); + ((System.ComponentModel.ISupportInitialize)(this.picIconHome)).EndInit(); + this.penBanner.ResumeLayout(false); + this.ResumeLayout(false); + + } + + #endregion + + private System.Windows.Forms.Panel penBanner; + private System.Windows.Forms.Label labTitle; + private System.Windows.Forms.Button btnExitSys; + private System.Windows.Forms.Panel panMenu; + private System.Windows.Forms.Label labHomeSelected; + private System.Windows.Forms.PictureBox picIconHome; + private System.Windows.Forms.Label labHomeText; + private System.Windows.Forms.Label labStatusText; + private System.Windows.Forms.PictureBox picIconStatus; + private RoundPanel panStatus; + private RoundPanel panHome; + private System.Windows.Forms.Label labStatusSelected; + } +} \ No newline at end of file diff --git a/RbFreqStandMeasure/RbFreqStdMeas.cs b/RbFreqStandMeasure/RbFreqStdMeas.cs new file mode 100644 index 0000000..3858ddb --- /dev/null +++ b/RbFreqStandMeasure/RbFreqStdMeas.cs @@ -0,0 +1,195 @@ +using Casic.Birmm.RbFreqStandMeasure.Properties; +using System; +using System.Collections.Generic; +using System.ComponentModel; +using System.Data; +using System.Drawing; +using System.Linq; +using System.Resources; +using System.Runtime.InteropServices; +using System.Text; +using System.Windows.Forms; + +namespace Casic.Birmm.RbFreqStandMeasure +{ + public partial class RbFreqStdMeas : Form + { + + #region 无边框拖动效果 + [DllImport("user32.dll")]//拖动无窗体的控件 + public static extern bool ReleaseCapture(); + [DllImport("user32.dll")] + public static extern bool SendMessage(IntPtr hwnd, int wMsg, int wParam, int lParam); + public const int WM_SYSCOMMAND = 0x0112; + public const int SC_MOVE = 0xF010; + public const int HTCAPTION = 0x0002; + + private void RbFreqStdMeas_MouseDown(object sender, MouseEventArgs e) + { + //拖动窗体 + ReleaseCapture(); + SendMessage(this.Handle, WM_SYSCOMMAND, SC_MOVE + HTCAPTION, 0); + } + #endregion + + private bool[] menuSelected = { true, false }; + // 按钮图标 + private PictureBox[] menuPics; + // 按钮图标的资源名称(选中的资源名称在后面加上 _selected) + private string[] menuIconResources; + // 按钮文本 + private Label[] menuLabels; + // 按钮下划线 + private Label[] menuUnderlines; + + private void ClearAllMenuSelected() + { + // 找到当前选中的按钮 + int index = 0; + for (int i = 0; i < this.menuSelected.Length; i++) + { + if (this.menuSelected[i] == true) + { + index = i; + break; + } + } + + // 将当前按钮的效果设置为默认未选中 + this.menuPics[index].BackgroundImage = (Bitmap)Resources.ResourceManager.GetObject(this.menuIconResources[index], null); + this.menuLabels[index].ForeColor = ColorTranslator.FromHtml("#2C2C2C"); + this.menuUnderlines[index].BackColor = Color.Transparent; + } + + #region 首页按钮点击、鼠标移入/移出效果 + private void HoverHome() + { + panHome.Back = ColorTranslator.FromHtml("#56a3f2"); + } + private void LeaveHome() + { + panHome.Back = Color.Transparent; + } + private void SelectHome() + { + // 移除所有按钮的选中样式 + this.ClearAllMenuSelected(); + + // 鼠标移入效果去掉 + LeaveHome(); + + // 重新设置所有按钮的状态 + this.menuSelected = new bool[] { true, false }; + + // 将新选中的按钮设置为选中 + this.picIconHome.BackgroundImage = (Bitmap)Resources.ResourceManager.GetObject("icon_home_selected", null); + this.labHomeText.ForeColor = ColorTranslator.FromHtml("#1296db"); + this.labHomeSelected.BackColor = ColorTranslator.FromHtml("#1296db"); + + } + #endregion + + #region 基准状态按钮点击、移入/移出效果 + private void HoverStatus() + { + panStatus.Back = ColorTranslator.FromHtml("#56a3f2"); + } + private void LeaveStatus() + { + panStatus.Back = Color.Transparent; + } + private void SelectStatus() + { + // 移除所有按钮的选中样式 + this.ClearAllMenuSelected(); + + // 鼠标移入效果去掉 + LeaveStatus(); + + // 重新设置所有按钮的状态 + this.menuSelected = new bool[] { false, true }; + + // 将新选中的按钮设置为选中 + this.picIconStatus.BackgroundImage = (Bitmap) Resources.ResourceManager.GetObject("icon_status_selected", null); + this.labStatusText.ForeColor = ColorTranslator.FromHtml("#1296db"); + this.labStatusSelected.BackColor = ColorTranslator.FromHtml("#1296db"); + } + #endregion + + public RbFreqStdMeas() + { + InitializeComponent(); + } + + private void RbFreqStdMeas_Load(object sender, EventArgs e) + { + this.menuPics = new PictureBox[] { this.picIconHome, this.picIconStatus }; + this.menuLabels = new Label[] { this.labHomeText, this.labStatusText }; + this.menuUnderlines = new Label[] { this.labHomeSelected, this.labStatusSelected }; + this.menuIconResources = new string[] { "icon_home", "icon_status" }; + } + + private void btnExitSys_Click(object sender, EventArgs e) + { + Application.Exit(); + } + + private void btnExitSys_MouseHover(object sender, EventArgs e) + { + ToolTip p = new ToolTip(); + p.ShowAlways = true; + p.SetToolTip(this.btnExitSys, "退出"); + } + + private void panHome_Click(object sender, EventArgs e) + { + if (this.menuSelected[0] == false) + { + this.SelectHome(); + } + } + + private void panHome_MouseHover(object sender, EventArgs e) + { + // 没有选中首页时才动作 + if (this.menuSelected[0] == false) + { + HoverHome(); + } + } + + private void panHome_MouseLeave(object sender, EventArgs e) + { + // 没有选中首页时才动作 + if (this.menuSelected[0] == false) + { + LeaveHome(); + } + } + + private void panStatus_Click(object sender, EventArgs e) + { + if (this.menuSelected[1] == false) + { + SelectStatus(); + } + } + + private void panStatus_MouseHover(object sender, EventArgs e) + { + if (this.menuSelected[1] == false) + { + HoverStatus(); + } + + } + + private void panStatus_MouseLeave(object sender, EventArgs e) + { + if (this.menuSelected[1] == false) + { + LeaveStatus(); + } + } + } +} \ No newline at end of file diff --git a/RbFreqStandMeasure/RbFreqStdMeas.resx b/RbFreqStandMeasure/RbFreqStdMeas.resx new file mode 100644 index 0000000..1af7de1 --- /dev/null +++ b/RbFreqStandMeasure/RbFreqStdMeas.resx @@ -0,0 +1,120 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + \ No newline at end of file diff --git a/RbFreqStandMeasure/res/images/bg_banner.png b/RbFreqStandMeasure/res/images/bg_banner.png new file mode 100644 index 0000000..d795b7d --- /dev/null +++ b/RbFreqStandMeasure/res/images/bg_banner.png Binary files differ diff --git a/RbFreqStandMeasure/res/images/icon_exit.png b/RbFreqStandMeasure/res/images/icon_exit.png new file mode 100644 index 0000000..997b9e9 --- /dev/null +++ b/RbFreqStandMeasure/res/images/icon_exit.png Binary files differ diff --git a/RbFreqStandMeasure/res/images/icon_home.png b/RbFreqStandMeasure/res/images/icon_home.png new file mode 100644 index 0000000..f200f25 --- /dev/null +++ b/RbFreqStandMeasure/res/images/icon_home.png Binary files differ diff --git a/RbFreqStandMeasure/Program.cs b/RbFreqStandMeasure/Program.cs index 0e902ab..93a83e5 100644 --- a/RbFreqStandMeasure/Program.cs +++ b/RbFreqStandMeasure/Program.cs @@ -15,7 +15,8 @@ { Application.EnableVisualStyles(); Application.SetCompatibleTextRenderingDefault(false); - Application.Run(new RbFreqStandMeasureForm()); + // Application.Run(new RbFreqStandMeasureForm()); + Application.Run(new RbFreqStdMeas()); } } } diff --git a/RbFreqStandMeasure/Properties/Resources.Designer.cs b/RbFreqStandMeasure/Properties/Resources.Designer.cs index 716ac6d..253d7d7 100644 --- a/RbFreqStandMeasure/Properties/Resources.Designer.cs +++ b/RbFreqStandMeasure/Properties/Resources.Designer.cs @@ -63,11 +63,71 @@ /// /// 查找 System.Drawing.Bitmap 类型的本地化资源。 /// + internal static System.Drawing.Bitmap bg_banner { + get { + object obj = ResourceManager.GetObject("bg_banner", resourceCulture); + return ((System.Drawing.Bitmap)(obj)); + } + } + + /// + /// 查找 System.Drawing.Bitmap 类型的本地化资源。 + /// internal static System.Drawing.Bitmap bg_white_shadow { get { object obj = ResourceManager.GetObject("bg_white_shadow", resourceCulture); return ((System.Drawing.Bitmap)(obj)); } } + + /// + /// 查找 System.Drawing.Bitmap 类型的本地化资源。 + /// + internal static System.Drawing.Bitmap icon_exit { + get { + object obj = ResourceManager.GetObject("icon_exit", resourceCulture); + return ((System.Drawing.Bitmap)(obj)); + } + } + + /// + /// 查找 System.Drawing.Bitmap 类型的本地化资源。 + /// + internal static System.Drawing.Bitmap icon_home { + get { + object obj = ResourceManager.GetObject("icon_home", resourceCulture); + return ((System.Drawing.Bitmap)(obj)); + } + } + + /// + /// 查找 System.Drawing.Bitmap 类型的本地化资源。 + /// + internal static System.Drawing.Bitmap icon_home_selected { + get { + object obj = ResourceManager.GetObject("icon_home_selected", resourceCulture); + return ((System.Drawing.Bitmap)(obj)); + } + } + + /// + /// 查找 System.Drawing.Bitmap 类型的本地化资源。 + /// + internal static System.Drawing.Bitmap icon_status { + get { + object obj = ResourceManager.GetObject("icon_status", resourceCulture); + return ((System.Drawing.Bitmap)(obj)); + } + } + + /// + /// 查找 System.Drawing.Bitmap 类型的本地化资源。 + /// + internal static System.Drawing.Bitmap icon_status_selected { + get { + object obj = ResourceManager.GetObject("icon_status_selected", resourceCulture); + return ((System.Drawing.Bitmap)(obj)); + } + } } } diff --git a/RbFreqStandMeasure/Properties/Resources.resx b/RbFreqStandMeasure/Properties/Resources.resx index 1435dab..e781bb7 100644 --- a/RbFreqStandMeasure/Properties/Resources.resx +++ b/RbFreqStandMeasure/Properties/Resources.resx @@ -118,7 +118,25 @@ System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + ..\res\images\icon_exit.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + ..\res\images\bg_white_shadow.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + ..\res\images\icon_home_selected.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + + ..\res\images\bg_banner.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + + ..\res\images\icon_home.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + + ..\res\images\icon_status.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + + ..\res\images\icon_status_selected.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + \ No newline at end of file diff --git a/RbFreqStandMeasure/RbFreqStandMeasure.csproj b/RbFreqStandMeasure/RbFreqStandMeasure.csproj index 35f244d..f5e7da9 100644 --- a/RbFreqStandMeasure/RbFreqStandMeasure.csproj +++ b/RbFreqStandMeasure/RbFreqStandMeasure.csproj @@ -126,6 +126,12 @@ + + Form + + + RbFreqStdMeas.cs + Component @@ -174,6 +180,9 @@ Resources.resx True + + RbFreqStdMeas.cs + SettingCtrlForm.cs @@ -205,6 +214,24 @@ + + + + + + + + + + + + + + + + + + diff --git a/RbFreqStandMeasure/RbFreqStdMeas.Designer.cs b/RbFreqStandMeasure/RbFreqStdMeas.Designer.cs new file mode 100644 index 0000000..57778cf --- /dev/null +++ b/RbFreqStandMeasure/RbFreqStdMeas.Designer.cs @@ -0,0 +1,248 @@ + +namespace Casic.Birmm.RbFreqStandMeasure +{ + partial class RbFreqStdMeas + { + /// + /// Required designer variable. + /// + private System.ComponentModel.IContainer components = null; + + /// + /// Clean up any resources being used. + /// + /// true if managed resources should be disposed; otherwise, false. + protected override void Dispose(bool disposing) + { + if (disposing && (components != null)) + { + components.Dispose(); + } + base.Dispose(disposing); + } + + #region Windows Form Designer generated code + + /// + /// Required method for Designer support - do not modify + /// the contents of this method with the code editor. + /// + private void InitializeComponent() + { + this.panMenu = new System.Windows.Forms.Panel(); + this.panStatus = new Casic.Birmm.RbFreqStandMeasure.RoundPanel(); + this.labStatusText = new System.Windows.Forms.Label(); + this.picIconStatus = new System.Windows.Forms.PictureBox(); + this.panHome = new Casic.Birmm.RbFreqStandMeasure.RoundPanel(); + this.labHomeText = new System.Windows.Forms.Label(); + this.picIconHome = new System.Windows.Forms.PictureBox(); + this.labHomeSelected = new System.Windows.Forms.Label(); + this.labStatusSelected = new System.Windows.Forms.Label(); + this.penBanner = new System.Windows.Forms.Panel(); + this.btnExitSys = new System.Windows.Forms.Button(); + this.labTitle = new System.Windows.Forms.Label(); + this.panMenu.SuspendLayout(); + this.panStatus.SuspendLayout(); + ((System.ComponentModel.ISupportInitialize)(this.picIconStatus)).BeginInit(); + this.panHome.SuspendLayout(); + ((System.ComponentModel.ISupportInitialize)(this.picIconHome)).BeginInit(); + this.penBanner.SuspendLayout(); + this.SuspendLayout(); + // + // panMenu + // + this.panMenu.BackColor = System.Drawing.Color.White; + this.panMenu.Controls.Add(this.panStatus); + this.panMenu.Controls.Add(this.panHome); + this.panMenu.Controls.Add(this.labStatusSelected); + this.panMenu.Location = new System.Drawing.Point(0, 64); + this.panMenu.Name = "panMenu"; + this.panMenu.Size = new System.Drawing.Size(1024, 50); + this.panMenu.TabIndex = 1; + // + // panStatus + // + this.panStatus.Back = System.Drawing.Color.Empty; + this.panStatus.BackColor = System.Drawing.Color.Transparent; + this.panStatus.Controls.Add(this.labStatusText); + this.panStatus.Controls.Add(this.picIconStatus); + this.panStatus.Location = new System.Drawing.Point(160, 0); + this.panStatus.MatrixRound = 8; + this.panStatus.Name = "panStatus"; + this.panStatus.Size = new System.Drawing.Size(130, 47); + this.panStatus.TabIndex = 1; + this.panStatus.Click += new System.EventHandler(this.panStatus_Click); + this.panStatus.MouseLeave += new System.EventHandler(this.panStatus_MouseLeave); + this.panStatus.MouseHover += new System.EventHandler(this.panStatus_MouseHover); + // + // labStatusText + // + this.labStatusText.BackColor = System.Drawing.Color.Transparent; + this.labStatusText.Cursor = System.Windows.Forms.Cursors.Hand; + this.labStatusText.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); + this.labStatusText.ForeColor = System.Drawing.SystemColors.ControlText; + this.labStatusText.Location = new System.Drawing.Point(35, 0); + this.labStatusText.Margin = new System.Windows.Forms.Padding(0); + this.labStatusText.Name = "labStatusText"; + this.labStatusText.Size = new System.Drawing.Size(85, 47); + this.labStatusText.TabIndex = 2; + this.labStatusText.Text = "基准状态"; + this.labStatusText.TextAlign = System.Drawing.ContentAlignment.MiddleRight; + this.labStatusText.Click += new System.EventHandler(this.panStatus_Click); + this.labStatusText.MouseLeave += new System.EventHandler(this.panStatus_MouseLeave); + this.labStatusText.MouseHover += new System.EventHandler(this.panStatus_MouseHover); + // + // picIconStatus + // + this.picIconStatus.BackgroundImage = global::Casic.Birmm.RbFreqStandMeasure.Properties.Resources.icon_status; + this.picIconStatus.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Zoom; + this.picIconStatus.Location = new System.Drawing.Point(10, 11); + this.picIconStatus.Name = "picIconStatus"; + this.picIconStatus.Size = new System.Drawing.Size(25, 25); + this.picIconStatus.TabIndex = 1; + this.picIconStatus.TabStop = false; + this.picIconStatus.Click += new System.EventHandler(this.panStatus_Click); + this.picIconStatus.MouseLeave += new System.EventHandler(this.panStatus_MouseLeave); + this.picIconStatus.MouseHover += new System.EventHandler(this.panStatus_MouseHover); + // + // panHome + // + this.panHome.Back = System.Drawing.Color.Empty; + this.panHome.Controls.Add(this.labHomeText); + this.panHome.Controls.Add(this.picIconHome); + this.panHome.Controls.Add(this.labHomeSelected); + this.panHome.Cursor = System.Windows.Forms.Cursors.Hand; + this.panHome.Location = new System.Drawing.Point(30, 0); + this.panHome.MatrixRound = 8; + this.panHome.Name = "panHome"; + this.panHome.Size = new System.Drawing.Size(100, 50); + this.panHome.TabIndex = 0; + this.panHome.Click += new System.EventHandler(this.panHome_Click); + this.panHome.MouseLeave += new System.EventHandler(this.panHome_MouseLeave); + this.panHome.MouseHover += new System.EventHandler(this.panHome_MouseHover); + // + // labHomeText + // + this.labHomeText.BackColor = System.Drawing.Color.Transparent; + this.labHomeText.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); + this.labHomeText.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(18)))), ((int)(((byte)(150)))), ((int)(((byte)(219))))); + this.labHomeText.Location = new System.Drawing.Point(35, 0); + this.labHomeText.Margin = new System.Windows.Forms.Padding(0); + this.labHomeText.Name = "labHomeText"; + this.labHomeText.Size = new System.Drawing.Size(55, 47); + this.labHomeText.TabIndex = 2; + this.labHomeText.Text = "首页"; + this.labHomeText.TextAlign = System.Drawing.ContentAlignment.MiddleRight; + this.labHomeText.Click += new System.EventHandler(this.panHome_Click); + this.labHomeText.MouseLeave += new System.EventHandler(this.panHome_MouseLeave); + this.labHomeText.MouseHover += new System.EventHandler(this.panHome_MouseHover); + // + // picIconHome + // + this.picIconHome.BackColor = System.Drawing.Color.Transparent; + this.picIconHome.BackgroundImage = global::Casic.Birmm.RbFreqStandMeasure.Properties.Resources.icon_home_selected; + this.picIconHome.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Zoom; + this.picIconHome.Location = new System.Drawing.Point(10, 11); + this.picIconHome.Name = "picIconHome"; + this.picIconHome.Size = new System.Drawing.Size(25, 25); + this.picIconHome.TabIndex = 1; + this.picIconHome.TabStop = false; + this.picIconHome.Click += new System.EventHandler(this.panHome_Click); + this.picIconHome.MouseLeave += new System.EventHandler(this.panHome_MouseLeave); + this.picIconHome.MouseHover += new System.EventHandler(this.panHome_MouseHover); + // + // labHomeSelected + // + this.labHomeSelected.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(18)))), ((int)(((byte)(150)))), ((int)(((byte)(219))))); + this.labHomeSelected.Location = new System.Drawing.Point(0, 47); + this.labHomeSelected.Name = "labHomeSelected"; + this.labHomeSelected.Size = new System.Drawing.Size(100, 3); + this.labHomeSelected.TabIndex = 0; + // + // labStatusSelected + // + this.labStatusSelected.BackColor = System.Drawing.Color.Transparent; + this.labStatusSelected.Location = new System.Drawing.Point(160, 47); + this.labStatusSelected.Margin = new System.Windows.Forms.Padding(0); + this.labStatusSelected.Name = "labStatusSelected"; + this.labStatusSelected.Size = new System.Drawing.Size(130, 3); + this.labStatusSelected.TabIndex = 0; + // + // penBanner + // + this.penBanner.BackgroundImage = global::Casic.Birmm.RbFreqStandMeasure.Properties.Resources.bg_banner; + this.penBanner.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Stretch; + this.penBanner.Controls.Add(this.btnExitSys); + this.penBanner.Controls.Add(this.labTitle); + this.penBanner.Location = new System.Drawing.Point(0, 0); + this.penBanner.Name = "penBanner"; + this.penBanner.Size = new System.Drawing.Size(1024, 64); + this.penBanner.TabIndex = 0; + this.penBanner.MouseDown += new System.Windows.Forms.MouseEventHandler(this.RbFreqStdMeas_MouseDown); + // + // btnExitSys + // + this.btnExitSys.BackColor = System.Drawing.Color.Transparent; + this.btnExitSys.BackgroundImage = global::Casic.Birmm.RbFreqStandMeasure.Properties.Resources.icon_exit; + this.btnExitSys.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Stretch; + this.btnExitSys.FlatAppearance.BorderSize = 0; + this.btnExitSys.FlatStyle = System.Windows.Forms.FlatStyle.Flat; + this.btnExitSys.ForeColor = System.Drawing.SystemColors.ControlDarkDark; + this.btnExitSys.Location = new System.Drawing.Point(974, 22); + this.btnExitSys.Margin = new System.Windows.Forms.Padding(0); + this.btnExitSys.Name = "btnExitSys"; + this.btnExitSys.Size = new System.Drawing.Size(20, 20); + this.btnExitSys.TabIndex = 1; + this.btnExitSys.UseVisualStyleBackColor = false; + this.btnExitSys.Click += new System.EventHandler(this.btnExitSys_Click); + this.btnExitSys.MouseHover += new System.EventHandler(this.btnExitSys_MouseHover); + // + // labTitle + // + this.labTitle.BackColor = System.Drawing.Color.Transparent; + this.labTitle.Font = new System.Drawing.Font("微软雅黑", 15.75F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(134))); + this.labTitle.ForeColor = System.Drawing.Color.White; + this.labTitle.Location = new System.Drawing.Point(30, 16); + this.labTitle.Name = "labTitle"; + this.labTitle.Size = new System.Drawing.Size(300, 32); + this.labTitle.TabIndex = 0; + this.labTitle.Text = "铷原子频标比对测量软件"; + this.labTitle.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; + // + // RbFreqStdMeas + // + this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.ClientSize = new System.Drawing.Size(1024, 768); + this.Controls.Add(this.panMenu); + this.Controls.Add(this.penBanner); + this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.None; + this.Name = "RbFreqStdMeas"; + this.Text = "RbFreqStdMeas"; + this.Load += new System.EventHandler(this.RbFreqStdMeas_Load); + this.panMenu.ResumeLayout(false); + this.panStatus.ResumeLayout(false); + ((System.ComponentModel.ISupportInitialize)(this.picIconStatus)).EndInit(); + this.panHome.ResumeLayout(false); + ((System.ComponentModel.ISupportInitialize)(this.picIconHome)).EndInit(); + this.penBanner.ResumeLayout(false); + this.ResumeLayout(false); + + } + + #endregion + + private System.Windows.Forms.Panel penBanner; + private System.Windows.Forms.Label labTitle; + private System.Windows.Forms.Button btnExitSys; + private System.Windows.Forms.Panel panMenu; + private System.Windows.Forms.Label labHomeSelected; + private System.Windows.Forms.PictureBox picIconHome; + private System.Windows.Forms.Label labHomeText; + private System.Windows.Forms.Label labStatusText; + private System.Windows.Forms.PictureBox picIconStatus; + private RoundPanel panStatus; + private RoundPanel panHome; + private System.Windows.Forms.Label labStatusSelected; + } +} \ No newline at end of file diff --git a/RbFreqStandMeasure/RbFreqStdMeas.cs b/RbFreqStandMeasure/RbFreqStdMeas.cs new file mode 100644 index 0000000..3858ddb --- /dev/null +++ b/RbFreqStandMeasure/RbFreqStdMeas.cs @@ -0,0 +1,195 @@ +using Casic.Birmm.RbFreqStandMeasure.Properties; +using System; +using System.Collections.Generic; +using System.ComponentModel; +using System.Data; +using System.Drawing; +using System.Linq; +using System.Resources; +using System.Runtime.InteropServices; +using System.Text; +using System.Windows.Forms; + +namespace Casic.Birmm.RbFreqStandMeasure +{ + public partial class RbFreqStdMeas : Form + { + + #region 无边框拖动效果 + [DllImport("user32.dll")]//拖动无窗体的控件 + public static extern bool ReleaseCapture(); + [DllImport("user32.dll")] + public static extern bool SendMessage(IntPtr hwnd, int wMsg, int wParam, int lParam); + public const int WM_SYSCOMMAND = 0x0112; + public const int SC_MOVE = 0xF010; + public const int HTCAPTION = 0x0002; + + private void RbFreqStdMeas_MouseDown(object sender, MouseEventArgs e) + { + //拖动窗体 + ReleaseCapture(); + SendMessage(this.Handle, WM_SYSCOMMAND, SC_MOVE + HTCAPTION, 0); + } + #endregion + + private bool[] menuSelected = { true, false }; + // 按钮图标 + private PictureBox[] menuPics; + // 按钮图标的资源名称(选中的资源名称在后面加上 _selected) + private string[] menuIconResources; + // 按钮文本 + private Label[] menuLabels; + // 按钮下划线 + private Label[] menuUnderlines; + + private void ClearAllMenuSelected() + { + // 找到当前选中的按钮 + int index = 0; + for (int i = 0; i < this.menuSelected.Length; i++) + { + if (this.menuSelected[i] == true) + { + index = i; + break; + } + } + + // 将当前按钮的效果设置为默认未选中 + this.menuPics[index].BackgroundImage = (Bitmap)Resources.ResourceManager.GetObject(this.menuIconResources[index], null); + this.menuLabels[index].ForeColor = ColorTranslator.FromHtml("#2C2C2C"); + this.menuUnderlines[index].BackColor = Color.Transparent; + } + + #region 首页按钮点击、鼠标移入/移出效果 + private void HoverHome() + { + panHome.Back = ColorTranslator.FromHtml("#56a3f2"); + } + private void LeaveHome() + { + panHome.Back = Color.Transparent; + } + private void SelectHome() + { + // 移除所有按钮的选中样式 + this.ClearAllMenuSelected(); + + // 鼠标移入效果去掉 + LeaveHome(); + + // 重新设置所有按钮的状态 + this.menuSelected = new bool[] { true, false }; + + // 将新选中的按钮设置为选中 + this.picIconHome.BackgroundImage = (Bitmap)Resources.ResourceManager.GetObject("icon_home_selected", null); + this.labHomeText.ForeColor = ColorTranslator.FromHtml("#1296db"); + this.labHomeSelected.BackColor = ColorTranslator.FromHtml("#1296db"); + + } + #endregion + + #region 基准状态按钮点击、移入/移出效果 + private void HoverStatus() + { + panStatus.Back = ColorTranslator.FromHtml("#56a3f2"); + } + private void LeaveStatus() + { + panStatus.Back = Color.Transparent; + } + private void SelectStatus() + { + // 移除所有按钮的选中样式 + this.ClearAllMenuSelected(); + + // 鼠标移入效果去掉 + LeaveStatus(); + + // 重新设置所有按钮的状态 + this.menuSelected = new bool[] { false, true }; + + // 将新选中的按钮设置为选中 + this.picIconStatus.BackgroundImage = (Bitmap) Resources.ResourceManager.GetObject("icon_status_selected", null); + this.labStatusText.ForeColor = ColorTranslator.FromHtml("#1296db"); + this.labStatusSelected.BackColor = ColorTranslator.FromHtml("#1296db"); + } + #endregion + + public RbFreqStdMeas() + { + InitializeComponent(); + } + + private void RbFreqStdMeas_Load(object sender, EventArgs e) + { + this.menuPics = new PictureBox[] { this.picIconHome, this.picIconStatus }; + this.menuLabels = new Label[] { this.labHomeText, this.labStatusText }; + this.menuUnderlines = new Label[] { this.labHomeSelected, this.labStatusSelected }; + this.menuIconResources = new string[] { "icon_home", "icon_status" }; + } + + private void btnExitSys_Click(object sender, EventArgs e) + { + Application.Exit(); + } + + private void btnExitSys_MouseHover(object sender, EventArgs e) + { + ToolTip p = new ToolTip(); + p.ShowAlways = true; + p.SetToolTip(this.btnExitSys, "退出"); + } + + private void panHome_Click(object sender, EventArgs e) + { + if (this.menuSelected[0] == false) + { + this.SelectHome(); + } + } + + private void panHome_MouseHover(object sender, EventArgs e) + { + // 没有选中首页时才动作 + if (this.menuSelected[0] == false) + { + HoverHome(); + } + } + + private void panHome_MouseLeave(object sender, EventArgs e) + { + // 没有选中首页时才动作 + if (this.menuSelected[0] == false) + { + LeaveHome(); + } + } + + private void panStatus_Click(object sender, EventArgs e) + { + if (this.menuSelected[1] == false) + { + SelectStatus(); + } + } + + private void panStatus_MouseHover(object sender, EventArgs e) + { + if (this.menuSelected[1] == false) + { + HoverStatus(); + } + + } + + private void panStatus_MouseLeave(object sender, EventArgs e) + { + if (this.menuSelected[1] == false) + { + LeaveStatus(); + } + } + } +} \ No newline at end of file diff --git a/RbFreqStandMeasure/RbFreqStdMeas.resx b/RbFreqStandMeasure/RbFreqStdMeas.resx new file mode 100644 index 0000000..1af7de1 --- /dev/null +++ b/RbFreqStandMeasure/RbFreqStdMeas.resx @@ -0,0 +1,120 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + \ No newline at end of file diff --git a/RbFreqStandMeasure/res/images/bg_banner.png b/RbFreqStandMeasure/res/images/bg_banner.png new file mode 100644 index 0000000..d795b7d --- /dev/null +++ b/RbFreqStandMeasure/res/images/bg_banner.png Binary files differ diff --git a/RbFreqStandMeasure/res/images/icon_exit.png b/RbFreqStandMeasure/res/images/icon_exit.png new file mode 100644 index 0000000..997b9e9 --- /dev/null +++ b/RbFreqStandMeasure/res/images/icon_exit.png Binary files differ diff --git a/RbFreqStandMeasure/res/images/icon_home.png b/RbFreqStandMeasure/res/images/icon_home.png new file mode 100644 index 0000000..f200f25 --- /dev/null +++ b/RbFreqStandMeasure/res/images/icon_home.png Binary files differ diff --git a/RbFreqStandMeasure/res/images/icon_home_selected.png b/RbFreqStandMeasure/res/images/icon_home_selected.png new file mode 100644 index 0000000..7a4feb4 --- /dev/null +++ b/RbFreqStandMeasure/res/images/icon_home_selected.png Binary files differ diff --git a/RbFreqStandMeasure/Program.cs b/RbFreqStandMeasure/Program.cs index 0e902ab..93a83e5 100644 --- a/RbFreqStandMeasure/Program.cs +++ b/RbFreqStandMeasure/Program.cs @@ -15,7 +15,8 @@ { Application.EnableVisualStyles(); Application.SetCompatibleTextRenderingDefault(false); - Application.Run(new RbFreqStandMeasureForm()); + // Application.Run(new RbFreqStandMeasureForm()); + Application.Run(new RbFreqStdMeas()); } } } diff --git a/RbFreqStandMeasure/Properties/Resources.Designer.cs b/RbFreqStandMeasure/Properties/Resources.Designer.cs index 716ac6d..253d7d7 100644 --- a/RbFreqStandMeasure/Properties/Resources.Designer.cs +++ b/RbFreqStandMeasure/Properties/Resources.Designer.cs @@ -63,11 +63,71 @@ /// /// 查找 System.Drawing.Bitmap 类型的本地化资源。 /// + internal static System.Drawing.Bitmap bg_banner { + get { + object obj = ResourceManager.GetObject("bg_banner", resourceCulture); + return ((System.Drawing.Bitmap)(obj)); + } + } + + /// + /// 查找 System.Drawing.Bitmap 类型的本地化资源。 + /// internal static System.Drawing.Bitmap bg_white_shadow { get { object obj = ResourceManager.GetObject("bg_white_shadow", resourceCulture); return ((System.Drawing.Bitmap)(obj)); } } + + /// + /// 查找 System.Drawing.Bitmap 类型的本地化资源。 + /// + internal static System.Drawing.Bitmap icon_exit { + get { + object obj = ResourceManager.GetObject("icon_exit", resourceCulture); + return ((System.Drawing.Bitmap)(obj)); + } + } + + /// + /// 查找 System.Drawing.Bitmap 类型的本地化资源。 + /// + internal static System.Drawing.Bitmap icon_home { + get { + object obj = ResourceManager.GetObject("icon_home", resourceCulture); + return ((System.Drawing.Bitmap)(obj)); + } + } + + /// + /// 查找 System.Drawing.Bitmap 类型的本地化资源。 + /// + internal static System.Drawing.Bitmap icon_home_selected { + get { + object obj = ResourceManager.GetObject("icon_home_selected", resourceCulture); + return ((System.Drawing.Bitmap)(obj)); + } + } + + /// + /// 查找 System.Drawing.Bitmap 类型的本地化资源。 + /// + internal static System.Drawing.Bitmap icon_status { + get { + object obj = ResourceManager.GetObject("icon_status", resourceCulture); + return ((System.Drawing.Bitmap)(obj)); + } + } + + /// + /// 查找 System.Drawing.Bitmap 类型的本地化资源。 + /// + internal static System.Drawing.Bitmap icon_status_selected { + get { + object obj = ResourceManager.GetObject("icon_status_selected", resourceCulture); + return ((System.Drawing.Bitmap)(obj)); + } + } } } diff --git a/RbFreqStandMeasure/Properties/Resources.resx b/RbFreqStandMeasure/Properties/Resources.resx index 1435dab..e781bb7 100644 --- a/RbFreqStandMeasure/Properties/Resources.resx +++ b/RbFreqStandMeasure/Properties/Resources.resx @@ -118,7 +118,25 @@ System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + ..\res\images\icon_exit.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + ..\res\images\bg_white_shadow.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + ..\res\images\icon_home_selected.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + + ..\res\images\bg_banner.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + + ..\res\images\icon_home.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + + ..\res\images\icon_status.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + + ..\res\images\icon_status_selected.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + \ No newline at end of file diff --git a/RbFreqStandMeasure/RbFreqStandMeasure.csproj b/RbFreqStandMeasure/RbFreqStandMeasure.csproj index 35f244d..f5e7da9 100644 --- a/RbFreqStandMeasure/RbFreqStandMeasure.csproj +++ b/RbFreqStandMeasure/RbFreqStandMeasure.csproj @@ -126,6 +126,12 @@ + + Form + + + RbFreqStdMeas.cs + Component @@ -174,6 +180,9 @@ Resources.resx True + + RbFreqStdMeas.cs + SettingCtrlForm.cs @@ -205,6 +214,24 @@ + + + + + + + + + + + + + + + + + + diff --git a/RbFreqStandMeasure/RbFreqStdMeas.Designer.cs b/RbFreqStandMeasure/RbFreqStdMeas.Designer.cs new file mode 100644 index 0000000..57778cf --- /dev/null +++ b/RbFreqStandMeasure/RbFreqStdMeas.Designer.cs @@ -0,0 +1,248 @@ + +namespace Casic.Birmm.RbFreqStandMeasure +{ + partial class RbFreqStdMeas + { + /// + /// Required designer variable. + /// + private System.ComponentModel.IContainer components = null; + + /// + /// Clean up any resources being used. + /// + /// true if managed resources should be disposed; otherwise, false. + protected override void Dispose(bool disposing) + { + if (disposing && (components != null)) + { + components.Dispose(); + } + base.Dispose(disposing); + } + + #region Windows Form Designer generated code + + /// + /// Required method for Designer support - do not modify + /// the contents of this method with the code editor. + /// + private void InitializeComponent() + { + this.panMenu = new System.Windows.Forms.Panel(); + this.panStatus = new Casic.Birmm.RbFreqStandMeasure.RoundPanel(); + this.labStatusText = new System.Windows.Forms.Label(); + this.picIconStatus = new System.Windows.Forms.PictureBox(); + this.panHome = new Casic.Birmm.RbFreqStandMeasure.RoundPanel(); + this.labHomeText = new System.Windows.Forms.Label(); + this.picIconHome = new System.Windows.Forms.PictureBox(); + this.labHomeSelected = new System.Windows.Forms.Label(); + this.labStatusSelected = new System.Windows.Forms.Label(); + this.penBanner = new System.Windows.Forms.Panel(); + this.btnExitSys = new System.Windows.Forms.Button(); + this.labTitle = new System.Windows.Forms.Label(); + this.panMenu.SuspendLayout(); + this.panStatus.SuspendLayout(); + ((System.ComponentModel.ISupportInitialize)(this.picIconStatus)).BeginInit(); + this.panHome.SuspendLayout(); + ((System.ComponentModel.ISupportInitialize)(this.picIconHome)).BeginInit(); + this.penBanner.SuspendLayout(); + this.SuspendLayout(); + // + // panMenu + // + this.panMenu.BackColor = System.Drawing.Color.White; + this.panMenu.Controls.Add(this.panStatus); + this.panMenu.Controls.Add(this.panHome); + this.panMenu.Controls.Add(this.labStatusSelected); + this.panMenu.Location = new System.Drawing.Point(0, 64); + this.panMenu.Name = "panMenu"; + this.panMenu.Size = new System.Drawing.Size(1024, 50); + this.panMenu.TabIndex = 1; + // + // panStatus + // + this.panStatus.Back = System.Drawing.Color.Empty; + this.panStatus.BackColor = System.Drawing.Color.Transparent; + this.panStatus.Controls.Add(this.labStatusText); + this.panStatus.Controls.Add(this.picIconStatus); + this.panStatus.Location = new System.Drawing.Point(160, 0); + this.panStatus.MatrixRound = 8; + this.panStatus.Name = "panStatus"; + this.panStatus.Size = new System.Drawing.Size(130, 47); + this.panStatus.TabIndex = 1; + this.panStatus.Click += new System.EventHandler(this.panStatus_Click); + this.panStatus.MouseLeave += new System.EventHandler(this.panStatus_MouseLeave); + this.panStatus.MouseHover += new System.EventHandler(this.panStatus_MouseHover); + // + // labStatusText + // + this.labStatusText.BackColor = System.Drawing.Color.Transparent; + this.labStatusText.Cursor = System.Windows.Forms.Cursors.Hand; + this.labStatusText.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); + this.labStatusText.ForeColor = System.Drawing.SystemColors.ControlText; + this.labStatusText.Location = new System.Drawing.Point(35, 0); + this.labStatusText.Margin = new System.Windows.Forms.Padding(0); + this.labStatusText.Name = "labStatusText"; + this.labStatusText.Size = new System.Drawing.Size(85, 47); + this.labStatusText.TabIndex = 2; + this.labStatusText.Text = "基准状态"; + this.labStatusText.TextAlign = System.Drawing.ContentAlignment.MiddleRight; + this.labStatusText.Click += new System.EventHandler(this.panStatus_Click); + this.labStatusText.MouseLeave += new System.EventHandler(this.panStatus_MouseLeave); + this.labStatusText.MouseHover += new System.EventHandler(this.panStatus_MouseHover); + // + // picIconStatus + // + this.picIconStatus.BackgroundImage = global::Casic.Birmm.RbFreqStandMeasure.Properties.Resources.icon_status; + this.picIconStatus.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Zoom; + this.picIconStatus.Location = new System.Drawing.Point(10, 11); + this.picIconStatus.Name = "picIconStatus"; + this.picIconStatus.Size = new System.Drawing.Size(25, 25); + this.picIconStatus.TabIndex = 1; + this.picIconStatus.TabStop = false; + this.picIconStatus.Click += new System.EventHandler(this.panStatus_Click); + this.picIconStatus.MouseLeave += new System.EventHandler(this.panStatus_MouseLeave); + this.picIconStatus.MouseHover += new System.EventHandler(this.panStatus_MouseHover); + // + // panHome + // + this.panHome.Back = System.Drawing.Color.Empty; + this.panHome.Controls.Add(this.labHomeText); + this.panHome.Controls.Add(this.picIconHome); + this.panHome.Controls.Add(this.labHomeSelected); + this.panHome.Cursor = System.Windows.Forms.Cursors.Hand; + this.panHome.Location = new System.Drawing.Point(30, 0); + this.panHome.MatrixRound = 8; + this.panHome.Name = "panHome"; + this.panHome.Size = new System.Drawing.Size(100, 50); + this.panHome.TabIndex = 0; + this.panHome.Click += new System.EventHandler(this.panHome_Click); + this.panHome.MouseLeave += new System.EventHandler(this.panHome_MouseLeave); + this.panHome.MouseHover += new System.EventHandler(this.panHome_MouseHover); + // + // labHomeText + // + this.labHomeText.BackColor = System.Drawing.Color.Transparent; + this.labHomeText.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); + this.labHomeText.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(18)))), ((int)(((byte)(150)))), ((int)(((byte)(219))))); + this.labHomeText.Location = new System.Drawing.Point(35, 0); + this.labHomeText.Margin = new System.Windows.Forms.Padding(0); + this.labHomeText.Name = "labHomeText"; + this.labHomeText.Size = new System.Drawing.Size(55, 47); + this.labHomeText.TabIndex = 2; + this.labHomeText.Text = "首页"; + this.labHomeText.TextAlign = System.Drawing.ContentAlignment.MiddleRight; + this.labHomeText.Click += new System.EventHandler(this.panHome_Click); + this.labHomeText.MouseLeave += new System.EventHandler(this.panHome_MouseLeave); + this.labHomeText.MouseHover += new System.EventHandler(this.panHome_MouseHover); + // + // picIconHome + // + this.picIconHome.BackColor = System.Drawing.Color.Transparent; + this.picIconHome.BackgroundImage = global::Casic.Birmm.RbFreqStandMeasure.Properties.Resources.icon_home_selected; + this.picIconHome.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Zoom; + this.picIconHome.Location = new System.Drawing.Point(10, 11); + this.picIconHome.Name = "picIconHome"; + this.picIconHome.Size = new System.Drawing.Size(25, 25); + this.picIconHome.TabIndex = 1; + this.picIconHome.TabStop = false; + this.picIconHome.Click += new System.EventHandler(this.panHome_Click); + this.picIconHome.MouseLeave += new System.EventHandler(this.panHome_MouseLeave); + this.picIconHome.MouseHover += new System.EventHandler(this.panHome_MouseHover); + // + // labHomeSelected + // + this.labHomeSelected.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(18)))), ((int)(((byte)(150)))), ((int)(((byte)(219))))); + this.labHomeSelected.Location = new System.Drawing.Point(0, 47); + this.labHomeSelected.Name = "labHomeSelected"; + this.labHomeSelected.Size = new System.Drawing.Size(100, 3); + this.labHomeSelected.TabIndex = 0; + // + // labStatusSelected + // + this.labStatusSelected.BackColor = System.Drawing.Color.Transparent; + this.labStatusSelected.Location = new System.Drawing.Point(160, 47); + this.labStatusSelected.Margin = new System.Windows.Forms.Padding(0); + this.labStatusSelected.Name = "labStatusSelected"; + this.labStatusSelected.Size = new System.Drawing.Size(130, 3); + this.labStatusSelected.TabIndex = 0; + // + // penBanner + // + this.penBanner.BackgroundImage = global::Casic.Birmm.RbFreqStandMeasure.Properties.Resources.bg_banner; + this.penBanner.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Stretch; + this.penBanner.Controls.Add(this.btnExitSys); + this.penBanner.Controls.Add(this.labTitle); + this.penBanner.Location = new System.Drawing.Point(0, 0); + this.penBanner.Name = "penBanner"; + this.penBanner.Size = new System.Drawing.Size(1024, 64); + this.penBanner.TabIndex = 0; + this.penBanner.MouseDown += new System.Windows.Forms.MouseEventHandler(this.RbFreqStdMeas_MouseDown); + // + // btnExitSys + // + this.btnExitSys.BackColor = System.Drawing.Color.Transparent; + this.btnExitSys.BackgroundImage = global::Casic.Birmm.RbFreqStandMeasure.Properties.Resources.icon_exit; + this.btnExitSys.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Stretch; + this.btnExitSys.FlatAppearance.BorderSize = 0; + this.btnExitSys.FlatStyle = System.Windows.Forms.FlatStyle.Flat; + this.btnExitSys.ForeColor = System.Drawing.SystemColors.ControlDarkDark; + this.btnExitSys.Location = new System.Drawing.Point(974, 22); + this.btnExitSys.Margin = new System.Windows.Forms.Padding(0); + this.btnExitSys.Name = "btnExitSys"; + this.btnExitSys.Size = new System.Drawing.Size(20, 20); + this.btnExitSys.TabIndex = 1; + this.btnExitSys.UseVisualStyleBackColor = false; + this.btnExitSys.Click += new System.EventHandler(this.btnExitSys_Click); + this.btnExitSys.MouseHover += new System.EventHandler(this.btnExitSys_MouseHover); + // + // labTitle + // + this.labTitle.BackColor = System.Drawing.Color.Transparent; + this.labTitle.Font = new System.Drawing.Font("微软雅黑", 15.75F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(134))); + this.labTitle.ForeColor = System.Drawing.Color.White; + this.labTitle.Location = new System.Drawing.Point(30, 16); + this.labTitle.Name = "labTitle"; + this.labTitle.Size = new System.Drawing.Size(300, 32); + this.labTitle.TabIndex = 0; + this.labTitle.Text = "铷原子频标比对测量软件"; + this.labTitle.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; + // + // RbFreqStdMeas + // + this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.ClientSize = new System.Drawing.Size(1024, 768); + this.Controls.Add(this.panMenu); + this.Controls.Add(this.penBanner); + this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.None; + this.Name = "RbFreqStdMeas"; + this.Text = "RbFreqStdMeas"; + this.Load += new System.EventHandler(this.RbFreqStdMeas_Load); + this.panMenu.ResumeLayout(false); + this.panStatus.ResumeLayout(false); + ((System.ComponentModel.ISupportInitialize)(this.picIconStatus)).EndInit(); + this.panHome.ResumeLayout(false); + ((System.ComponentModel.ISupportInitialize)(this.picIconHome)).EndInit(); + this.penBanner.ResumeLayout(false); + this.ResumeLayout(false); + + } + + #endregion + + private System.Windows.Forms.Panel penBanner; + private System.Windows.Forms.Label labTitle; + private System.Windows.Forms.Button btnExitSys; + private System.Windows.Forms.Panel panMenu; + private System.Windows.Forms.Label labHomeSelected; + private System.Windows.Forms.PictureBox picIconHome; + private System.Windows.Forms.Label labHomeText; + private System.Windows.Forms.Label labStatusText; + private System.Windows.Forms.PictureBox picIconStatus; + private RoundPanel panStatus; + private RoundPanel panHome; + private System.Windows.Forms.Label labStatusSelected; + } +} \ No newline at end of file diff --git a/RbFreqStandMeasure/RbFreqStdMeas.cs b/RbFreqStandMeasure/RbFreqStdMeas.cs new file mode 100644 index 0000000..3858ddb --- /dev/null +++ b/RbFreqStandMeasure/RbFreqStdMeas.cs @@ -0,0 +1,195 @@ +using Casic.Birmm.RbFreqStandMeasure.Properties; +using System; +using System.Collections.Generic; +using System.ComponentModel; +using System.Data; +using System.Drawing; +using System.Linq; +using System.Resources; +using System.Runtime.InteropServices; +using System.Text; +using System.Windows.Forms; + +namespace Casic.Birmm.RbFreqStandMeasure +{ + public partial class RbFreqStdMeas : Form + { + + #region 无边框拖动效果 + [DllImport("user32.dll")]//拖动无窗体的控件 + public static extern bool ReleaseCapture(); + [DllImport("user32.dll")] + public static extern bool SendMessage(IntPtr hwnd, int wMsg, int wParam, int lParam); + public const int WM_SYSCOMMAND = 0x0112; + public const int SC_MOVE = 0xF010; + public const int HTCAPTION = 0x0002; + + private void RbFreqStdMeas_MouseDown(object sender, MouseEventArgs e) + { + //拖动窗体 + ReleaseCapture(); + SendMessage(this.Handle, WM_SYSCOMMAND, SC_MOVE + HTCAPTION, 0); + } + #endregion + + private bool[] menuSelected = { true, false }; + // 按钮图标 + private PictureBox[] menuPics; + // 按钮图标的资源名称(选中的资源名称在后面加上 _selected) + private string[] menuIconResources; + // 按钮文本 + private Label[] menuLabels; + // 按钮下划线 + private Label[] menuUnderlines; + + private void ClearAllMenuSelected() + { + // 找到当前选中的按钮 + int index = 0; + for (int i = 0; i < this.menuSelected.Length; i++) + { + if (this.menuSelected[i] == true) + { + index = i; + break; + } + } + + // 将当前按钮的效果设置为默认未选中 + this.menuPics[index].BackgroundImage = (Bitmap)Resources.ResourceManager.GetObject(this.menuIconResources[index], null); + this.menuLabels[index].ForeColor = ColorTranslator.FromHtml("#2C2C2C"); + this.menuUnderlines[index].BackColor = Color.Transparent; + } + + #region 首页按钮点击、鼠标移入/移出效果 + private void HoverHome() + { + panHome.Back = ColorTranslator.FromHtml("#56a3f2"); + } + private void LeaveHome() + { + panHome.Back = Color.Transparent; + } + private void SelectHome() + { + // 移除所有按钮的选中样式 + this.ClearAllMenuSelected(); + + // 鼠标移入效果去掉 + LeaveHome(); + + // 重新设置所有按钮的状态 + this.menuSelected = new bool[] { true, false }; + + // 将新选中的按钮设置为选中 + this.picIconHome.BackgroundImage = (Bitmap)Resources.ResourceManager.GetObject("icon_home_selected", null); + this.labHomeText.ForeColor = ColorTranslator.FromHtml("#1296db"); + this.labHomeSelected.BackColor = ColorTranslator.FromHtml("#1296db"); + + } + #endregion + + #region 基准状态按钮点击、移入/移出效果 + private void HoverStatus() + { + panStatus.Back = ColorTranslator.FromHtml("#56a3f2"); + } + private void LeaveStatus() + { + panStatus.Back = Color.Transparent; + } + private void SelectStatus() + { + // 移除所有按钮的选中样式 + this.ClearAllMenuSelected(); + + // 鼠标移入效果去掉 + LeaveStatus(); + + // 重新设置所有按钮的状态 + this.menuSelected = new bool[] { false, true }; + + // 将新选中的按钮设置为选中 + this.picIconStatus.BackgroundImage = (Bitmap) Resources.ResourceManager.GetObject("icon_status_selected", null); + this.labStatusText.ForeColor = ColorTranslator.FromHtml("#1296db"); + this.labStatusSelected.BackColor = ColorTranslator.FromHtml("#1296db"); + } + #endregion + + public RbFreqStdMeas() + { + InitializeComponent(); + } + + private void RbFreqStdMeas_Load(object sender, EventArgs e) + { + this.menuPics = new PictureBox[] { this.picIconHome, this.picIconStatus }; + this.menuLabels = new Label[] { this.labHomeText, this.labStatusText }; + this.menuUnderlines = new Label[] { this.labHomeSelected, this.labStatusSelected }; + this.menuIconResources = new string[] { "icon_home", "icon_status" }; + } + + private void btnExitSys_Click(object sender, EventArgs e) + { + Application.Exit(); + } + + private void btnExitSys_MouseHover(object sender, EventArgs e) + { + ToolTip p = new ToolTip(); + p.ShowAlways = true; + p.SetToolTip(this.btnExitSys, "退出"); + } + + private void panHome_Click(object sender, EventArgs e) + { + if (this.menuSelected[0] == false) + { + this.SelectHome(); + } + } + + private void panHome_MouseHover(object sender, EventArgs e) + { + // 没有选中首页时才动作 + if (this.menuSelected[0] == false) + { + HoverHome(); + } + } + + private void panHome_MouseLeave(object sender, EventArgs e) + { + // 没有选中首页时才动作 + if (this.menuSelected[0] == false) + { + LeaveHome(); + } + } + + private void panStatus_Click(object sender, EventArgs e) + { + if (this.menuSelected[1] == false) + { + SelectStatus(); + } + } + + private void panStatus_MouseHover(object sender, EventArgs e) + { + if (this.menuSelected[1] == false) + { + HoverStatus(); + } + + } + + private void panStatus_MouseLeave(object sender, EventArgs e) + { + if (this.menuSelected[1] == false) + { + LeaveStatus(); + } + } + } +} \ No newline at end of file diff --git a/RbFreqStandMeasure/RbFreqStdMeas.resx b/RbFreqStandMeasure/RbFreqStdMeas.resx new file mode 100644 index 0000000..1af7de1 --- /dev/null +++ b/RbFreqStandMeasure/RbFreqStdMeas.resx @@ -0,0 +1,120 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + \ No newline at end of file diff --git a/RbFreqStandMeasure/res/images/bg_banner.png b/RbFreqStandMeasure/res/images/bg_banner.png new file mode 100644 index 0000000..d795b7d --- /dev/null +++ b/RbFreqStandMeasure/res/images/bg_banner.png Binary files differ diff --git a/RbFreqStandMeasure/res/images/icon_exit.png b/RbFreqStandMeasure/res/images/icon_exit.png new file mode 100644 index 0000000..997b9e9 --- /dev/null +++ b/RbFreqStandMeasure/res/images/icon_exit.png Binary files differ diff --git a/RbFreqStandMeasure/res/images/icon_home.png b/RbFreqStandMeasure/res/images/icon_home.png new file mode 100644 index 0000000..f200f25 --- /dev/null +++ b/RbFreqStandMeasure/res/images/icon_home.png Binary files differ diff --git a/RbFreqStandMeasure/res/images/icon_home_selected.png b/RbFreqStandMeasure/res/images/icon_home_selected.png new file mode 100644 index 0000000..7a4feb4 --- /dev/null +++ b/RbFreqStandMeasure/res/images/icon_home_selected.png Binary files differ diff --git a/RbFreqStandMeasure/res/images/icon_status.png b/RbFreqStandMeasure/res/images/icon_status.png new file mode 100644 index 0000000..67bda58 --- /dev/null +++ b/RbFreqStandMeasure/res/images/icon_status.png Binary files differ diff --git a/RbFreqStandMeasure/Program.cs b/RbFreqStandMeasure/Program.cs index 0e902ab..93a83e5 100644 --- a/RbFreqStandMeasure/Program.cs +++ b/RbFreqStandMeasure/Program.cs @@ -15,7 +15,8 @@ { Application.EnableVisualStyles(); Application.SetCompatibleTextRenderingDefault(false); - Application.Run(new RbFreqStandMeasureForm()); + // Application.Run(new RbFreqStandMeasureForm()); + Application.Run(new RbFreqStdMeas()); } } } diff --git a/RbFreqStandMeasure/Properties/Resources.Designer.cs b/RbFreqStandMeasure/Properties/Resources.Designer.cs index 716ac6d..253d7d7 100644 --- a/RbFreqStandMeasure/Properties/Resources.Designer.cs +++ b/RbFreqStandMeasure/Properties/Resources.Designer.cs @@ -63,11 +63,71 @@ /// /// 查找 System.Drawing.Bitmap 类型的本地化资源。 /// + internal static System.Drawing.Bitmap bg_banner { + get { + object obj = ResourceManager.GetObject("bg_banner", resourceCulture); + return ((System.Drawing.Bitmap)(obj)); + } + } + + /// + /// 查找 System.Drawing.Bitmap 类型的本地化资源。 + /// internal static System.Drawing.Bitmap bg_white_shadow { get { object obj = ResourceManager.GetObject("bg_white_shadow", resourceCulture); return ((System.Drawing.Bitmap)(obj)); } } + + /// + /// 查找 System.Drawing.Bitmap 类型的本地化资源。 + /// + internal static System.Drawing.Bitmap icon_exit { + get { + object obj = ResourceManager.GetObject("icon_exit", resourceCulture); + return ((System.Drawing.Bitmap)(obj)); + } + } + + /// + /// 查找 System.Drawing.Bitmap 类型的本地化资源。 + /// + internal static System.Drawing.Bitmap icon_home { + get { + object obj = ResourceManager.GetObject("icon_home", resourceCulture); + return ((System.Drawing.Bitmap)(obj)); + } + } + + /// + /// 查找 System.Drawing.Bitmap 类型的本地化资源。 + /// + internal static System.Drawing.Bitmap icon_home_selected { + get { + object obj = ResourceManager.GetObject("icon_home_selected", resourceCulture); + return ((System.Drawing.Bitmap)(obj)); + } + } + + /// + /// 查找 System.Drawing.Bitmap 类型的本地化资源。 + /// + internal static System.Drawing.Bitmap icon_status { + get { + object obj = ResourceManager.GetObject("icon_status", resourceCulture); + return ((System.Drawing.Bitmap)(obj)); + } + } + + /// + /// 查找 System.Drawing.Bitmap 类型的本地化资源。 + /// + internal static System.Drawing.Bitmap icon_status_selected { + get { + object obj = ResourceManager.GetObject("icon_status_selected", resourceCulture); + return ((System.Drawing.Bitmap)(obj)); + } + } } } diff --git a/RbFreqStandMeasure/Properties/Resources.resx b/RbFreqStandMeasure/Properties/Resources.resx index 1435dab..e781bb7 100644 --- a/RbFreqStandMeasure/Properties/Resources.resx +++ b/RbFreqStandMeasure/Properties/Resources.resx @@ -118,7 +118,25 @@ System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + ..\res\images\icon_exit.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + ..\res\images\bg_white_shadow.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + ..\res\images\icon_home_selected.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + + ..\res\images\bg_banner.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + + ..\res\images\icon_home.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + + ..\res\images\icon_status.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + + ..\res\images\icon_status_selected.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + \ No newline at end of file diff --git a/RbFreqStandMeasure/RbFreqStandMeasure.csproj b/RbFreqStandMeasure/RbFreqStandMeasure.csproj index 35f244d..f5e7da9 100644 --- a/RbFreqStandMeasure/RbFreqStandMeasure.csproj +++ b/RbFreqStandMeasure/RbFreqStandMeasure.csproj @@ -126,6 +126,12 @@ + + Form + + + RbFreqStdMeas.cs + Component @@ -174,6 +180,9 @@ Resources.resx True + + RbFreqStdMeas.cs + SettingCtrlForm.cs @@ -205,6 +214,24 @@ + + + + + + + + + + + + + + + + + + diff --git a/RbFreqStandMeasure/RbFreqStdMeas.Designer.cs b/RbFreqStandMeasure/RbFreqStdMeas.Designer.cs new file mode 100644 index 0000000..57778cf --- /dev/null +++ b/RbFreqStandMeasure/RbFreqStdMeas.Designer.cs @@ -0,0 +1,248 @@ + +namespace Casic.Birmm.RbFreqStandMeasure +{ + partial class RbFreqStdMeas + { + /// + /// Required designer variable. + /// + private System.ComponentModel.IContainer components = null; + + /// + /// Clean up any resources being used. + /// + /// true if managed resources should be disposed; otherwise, false. + protected override void Dispose(bool disposing) + { + if (disposing && (components != null)) + { + components.Dispose(); + } + base.Dispose(disposing); + } + + #region Windows Form Designer generated code + + /// + /// Required method for Designer support - do not modify + /// the contents of this method with the code editor. + /// + private void InitializeComponent() + { + this.panMenu = new System.Windows.Forms.Panel(); + this.panStatus = new Casic.Birmm.RbFreqStandMeasure.RoundPanel(); + this.labStatusText = new System.Windows.Forms.Label(); + this.picIconStatus = new System.Windows.Forms.PictureBox(); + this.panHome = new Casic.Birmm.RbFreqStandMeasure.RoundPanel(); + this.labHomeText = new System.Windows.Forms.Label(); + this.picIconHome = new System.Windows.Forms.PictureBox(); + this.labHomeSelected = new System.Windows.Forms.Label(); + this.labStatusSelected = new System.Windows.Forms.Label(); + this.penBanner = new System.Windows.Forms.Panel(); + this.btnExitSys = new System.Windows.Forms.Button(); + this.labTitle = new System.Windows.Forms.Label(); + this.panMenu.SuspendLayout(); + this.panStatus.SuspendLayout(); + ((System.ComponentModel.ISupportInitialize)(this.picIconStatus)).BeginInit(); + this.panHome.SuspendLayout(); + ((System.ComponentModel.ISupportInitialize)(this.picIconHome)).BeginInit(); + this.penBanner.SuspendLayout(); + this.SuspendLayout(); + // + // panMenu + // + this.panMenu.BackColor = System.Drawing.Color.White; + this.panMenu.Controls.Add(this.panStatus); + this.panMenu.Controls.Add(this.panHome); + this.panMenu.Controls.Add(this.labStatusSelected); + this.panMenu.Location = new System.Drawing.Point(0, 64); + this.panMenu.Name = "panMenu"; + this.panMenu.Size = new System.Drawing.Size(1024, 50); + this.panMenu.TabIndex = 1; + // + // panStatus + // + this.panStatus.Back = System.Drawing.Color.Empty; + this.panStatus.BackColor = System.Drawing.Color.Transparent; + this.panStatus.Controls.Add(this.labStatusText); + this.panStatus.Controls.Add(this.picIconStatus); + this.panStatus.Location = new System.Drawing.Point(160, 0); + this.panStatus.MatrixRound = 8; + this.panStatus.Name = "panStatus"; + this.panStatus.Size = new System.Drawing.Size(130, 47); + this.panStatus.TabIndex = 1; + this.panStatus.Click += new System.EventHandler(this.panStatus_Click); + this.panStatus.MouseLeave += new System.EventHandler(this.panStatus_MouseLeave); + this.panStatus.MouseHover += new System.EventHandler(this.panStatus_MouseHover); + // + // labStatusText + // + this.labStatusText.BackColor = System.Drawing.Color.Transparent; + this.labStatusText.Cursor = System.Windows.Forms.Cursors.Hand; + this.labStatusText.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); + this.labStatusText.ForeColor = System.Drawing.SystemColors.ControlText; + this.labStatusText.Location = new System.Drawing.Point(35, 0); + this.labStatusText.Margin = new System.Windows.Forms.Padding(0); + this.labStatusText.Name = "labStatusText"; + this.labStatusText.Size = new System.Drawing.Size(85, 47); + this.labStatusText.TabIndex = 2; + this.labStatusText.Text = "基准状态"; + this.labStatusText.TextAlign = System.Drawing.ContentAlignment.MiddleRight; + this.labStatusText.Click += new System.EventHandler(this.panStatus_Click); + this.labStatusText.MouseLeave += new System.EventHandler(this.panStatus_MouseLeave); + this.labStatusText.MouseHover += new System.EventHandler(this.panStatus_MouseHover); + // + // picIconStatus + // + this.picIconStatus.BackgroundImage = global::Casic.Birmm.RbFreqStandMeasure.Properties.Resources.icon_status; + this.picIconStatus.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Zoom; + this.picIconStatus.Location = new System.Drawing.Point(10, 11); + this.picIconStatus.Name = "picIconStatus"; + this.picIconStatus.Size = new System.Drawing.Size(25, 25); + this.picIconStatus.TabIndex = 1; + this.picIconStatus.TabStop = false; + this.picIconStatus.Click += new System.EventHandler(this.panStatus_Click); + this.picIconStatus.MouseLeave += new System.EventHandler(this.panStatus_MouseLeave); + this.picIconStatus.MouseHover += new System.EventHandler(this.panStatus_MouseHover); + // + // panHome + // + this.panHome.Back = System.Drawing.Color.Empty; + this.panHome.Controls.Add(this.labHomeText); + this.panHome.Controls.Add(this.picIconHome); + this.panHome.Controls.Add(this.labHomeSelected); + this.panHome.Cursor = System.Windows.Forms.Cursors.Hand; + this.panHome.Location = new System.Drawing.Point(30, 0); + this.panHome.MatrixRound = 8; + this.panHome.Name = "panHome"; + this.panHome.Size = new System.Drawing.Size(100, 50); + this.panHome.TabIndex = 0; + this.panHome.Click += new System.EventHandler(this.panHome_Click); + this.panHome.MouseLeave += new System.EventHandler(this.panHome_MouseLeave); + this.panHome.MouseHover += new System.EventHandler(this.panHome_MouseHover); + // + // labHomeText + // + this.labHomeText.BackColor = System.Drawing.Color.Transparent; + this.labHomeText.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); + this.labHomeText.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(18)))), ((int)(((byte)(150)))), ((int)(((byte)(219))))); + this.labHomeText.Location = new System.Drawing.Point(35, 0); + this.labHomeText.Margin = new System.Windows.Forms.Padding(0); + this.labHomeText.Name = "labHomeText"; + this.labHomeText.Size = new System.Drawing.Size(55, 47); + this.labHomeText.TabIndex = 2; + this.labHomeText.Text = "首页"; + this.labHomeText.TextAlign = System.Drawing.ContentAlignment.MiddleRight; + this.labHomeText.Click += new System.EventHandler(this.panHome_Click); + this.labHomeText.MouseLeave += new System.EventHandler(this.panHome_MouseLeave); + this.labHomeText.MouseHover += new System.EventHandler(this.panHome_MouseHover); + // + // picIconHome + // + this.picIconHome.BackColor = System.Drawing.Color.Transparent; + this.picIconHome.BackgroundImage = global::Casic.Birmm.RbFreqStandMeasure.Properties.Resources.icon_home_selected; + this.picIconHome.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Zoom; + this.picIconHome.Location = new System.Drawing.Point(10, 11); + this.picIconHome.Name = "picIconHome"; + this.picIconHome.Size = new System.Drawing.Size(25, 25); + this.picIconHome.TabIndex = 1; + this.picIconHome.TabStop = false; + this.picIconHome.Click += new System.EventHandler(this.panHome_Click); + this.picIconHome.MouseLeave += new System.EventHandler(this.panHome_MouseLeave); + this.picIconHome.MouseHover += new System.EventHandler(this.panHome_MouseHover); + // + // labHomeSelected + // + this.labHomeSelected.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(18)))), ((int)(((byte)(150)))), ((int)(((byte)(219))))); + this.labHomeSelected.Location = new System.Drawing.Point(0, 47); + this.labHomeSelected.Name = "labHomeSelected"; + this.labHomeSelected.Size = new System.Drawing.Size(100, 3); + this.labHomeSelected.TabIndex = 0; + // + // labStatusSelected + // + this.labStatusSelected.BackColor = System.Drawing.Color.Transparent; + this.labStatusSelected.Location = new System.Drawing.Point(160, 47); + this.labStatusSelected.Margin = new System.Windows.Forms.Padding(0); + this.labStatusSelected.Name = "labStatusSelected"; + this.labStatusSelected.Size = new System.Drawing.Size(130, 3); + this.labStatusSelected.TabIndex = 0; + // + // penBanner + // + this.penBanner.BackgroundImage = global::Casic.Birmm.RbFreqStandMeasure.Properties.Resources.bg_banner; + this.penBanner.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Stretch; + this.penBanner.Controls.Add(this.btnExitSys); + this.penBanner.Controls.Add(this.labTitle); + this.penBanner.Location = new System.Drawing.Point(0, 0); + this.penBanner.Name = "penBanner"; + this.penBanner.Size = new System.Drawing.Size(1024, 64); + this.penBanner.TabIndex = 0; + this.penBanner.MouseDown += new System.Windows.Forms.MouseEventHandler(this.RbFreqStdMeas_MouseDown); + // + // btnExitSys + // + this.btnExitSys.BackColor = System.Drawing.Color.Transparent; + this.btnExitSys.BackgroundImage = global::Casic.Birmm.RbFreqStandMeasure.Properties.Resources.icon_exit; + this.btnExitSys.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Stretch; + this.btnExitSys.FlatAppearance.BorderSize = 0; + this.btnExitSys.FlatStyle = System.Windows.Forms.FlatStyle.Flat; + this.btnExitSys.ForeColor = System.Drawing.SystemColors.ControlDarkDark; + this.btnExitSys.Location = new System.Drawing.Point(974, 22); + this.btnExitSys.Margin = new System.Windows.Forms.Padding(0); + this.btnExitSys.Name = "btnExitSys"; + this.btnExitSys.Size = new System.Drawing.Size(20, 20); + this.btnExitSys.TabIndex = 1; + this.btnExitSys.UseVisualStyleBackColor = false; + this.btnExitSys.Click += new System.EventHandler(this.btnExitSys_Click); + this.btnExitSys.MouseHover += new System.EventHandler(this.btnExitSys_MouseHover); + // + // labTitle + // + this.labTitle.BackColor = System.Drawing.Color.Transparent; + this.labTitle.Font = new System.Drawing.Font("微软雅黑", 15.75F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(134))); + this.labTitle.ForeColor = System.Drawing.Color.White; + this.labTitle.Location = new System.Drawing.Point(30, 16); + this.labTitle.Name = "labTitle"; + this.labTitle.Size = new System.Drawing.Size(300, 32); + this.labTitle.TabIndex = 0; + this.labTitle.Text = "铷原子频标比对测量软件"; + this.labTitle.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; + // + // RbFreqStdMeas + // + this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.ClientSize = new System.Drawing.Size(1024, 768); + this.Controls.Add(this.panMenu); + this.Controls.Add(this.penBanner); + this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.None; + this.Name = "RbFreqStdMeas"; + this.Text = "RbFreqStdMeas"; + this.Load += new System.EventHandler(this.RbFreqStdMeas_Load); + this.panMenu.ResumeLayout(false); + this.panStatus.ResumeLayout(false); + ((System.ComponentModel.ISupportInitialize)(this.picIconStatus)).EndInit(); + this.panHome.ResumeLayout(false); + ((System.ComponentModel.ISupportInitialize)(this.picIconHome)).EndInit(); + this.penBanner.ResumeLayout(false); + this.ResumeLayout(false); + + } + + #endregion + + private System.Windows.Forms.Panel penBanner; + private System.Windows.Forms.Label labTitle; + private System.Windows.Forms.Button btnExitSys; + private System.Windows.Forms.Panel panMenu; + private System.Windows.Forms.Label labHomeSelected; + private System.Windows.Forms.PictureBox picIconHome; + private System.Windows.Forms.Label labHomeText; + private System.Windows.Forms.Label labStatusText; + private System.Windows.Forms.PictureBox picIconStatus; + private RoundPanel panStatus; + private RoundPanel panHome; + private System.Windows.Forms.Label labStatusSelected; + } +} \ No newline at end of file diff --git a/RbFreqStandMeasure/RbFreqStdMeas.cs b/RbFreqStandMeasure/RbFreqStdMeas.cs new file mode 100644 index 0000000..3858ddb --- /dev/null +++ b/RbFreqStandMeasure/RbFreqStdMeas.cs @@ -0,0 +1,195 @@ +using Casic.Birmm.RbFreqStandMeasure.Properties; +using System; +using System.Collections.Generic; +using System.ComponentModel; +using System.Data; +using System.Drawing; +using System.Linq; +using System.Resources; +using System.Runtime.InteropServices; +using System.Text; +using System.Windows.Forms; + +namespace Casic.Birmm.RbFreqStandMeasure +{ + public partial class RbFreqStdMeas : Form + { + + #region 无边框拖动效果 + [DllImport("user32.dll")]//拖动无窗体的控件 + public static extern bool ReleaseCapture(); + [DllImport("user32.dll")] + public static extern bool SendMessage(IntPtr hwnd, int wMsg, int wParam, int lParam); + public const int WM_SYSCOMMAND = 0x0112; + public const int SC_MOVE = 0xF010; + public const int HTCAPTION = 0x0002; + + private void RbFreqStdMeas_MouseDown(object sender, MouseEventArgs e) + { + //拖动窗体 + ReleaseCapture(); + SendMessage(this.Handle, WM_SYSCOMMAND, SC_MOVE + HTCAPTION, 0); + } + #endregion + + private bool[] menuSelected = { true, false }; + // 按钮图标 + private PictureBox[] menuPics; + // 按钮图标的资源名称(选中的资源名称在后面加上 _selected) + private string[] menuIconResources; + // 按钮文本 + private Label[] menuLabels; + // 按钮下划线 + private Label[] menuUnderlines; + + private void ClearAllMenuSelected() + { + // 找到当前选中的按钮 + int index = 0; + for (int i = 0; i < this.menuSelected.Length; i++) + { + if (this.menuSelected[i] == true) + { + index = i; + break; + } + } + + // 将当前按钮的效果设置为默认未选中 + this.menuPics[index].BackgroundImage = (Bitmap)Resources.ResourceManager.GetObject(this.menuIconResources[index], null); + this.menuLabels[index].ForeColor = ColorTranslator.FromHtml("#2C2C2C"); + this.menuUnderlines[index].BackColor = Color.Transparent; + } + + #region 首页按钮点击、鼠标移入/移出效果 + private void HoverHome() + { + panHome.Back = ColorTranslator.FromHtml("#56a3f2"); + } + private void LeaveHome() + { + panHome.Back = Color.Transparent; + } + private void SelectHome() + { + // 移除所有按钮的选中样式 + this.ClearAllMenuSelected(); + + // 鼠标移入效果去掉 + LeaveHome(); + + // 重新设置所有按钮的状态 + this.menuSelected = new bool[] { true, false }; + + // 将新选中的按钮设置为选中 + this.picIconHome.BackgroundImage = (Bitmap)Resources.ResourceManager.GetObject("icon_home_selected", null); + this.labHomeText.ForeColor = ColorTranslator.FromHtml("#1296db"); + this.labHomeSelected.BackColor = ColorTranslator.FromHtml("#1296db"); + + } + #endregion + + #region 基准状态按钮点击、移入/移出效果 + private void HoverStatus() + { + panStatus.Back = ColorTranslator.FromHtml("#56a3f2"); + } + private void LeaveStatus() + { + panStatus.Back = Color.Transparent; + } + private void SelectStatus() + { + // 移除所有按钮的选中样式 + this.ClearAllMenuSelected(); + + // 鼠标移入效果去掉 + LeaveStatus(); + + // 重新设置所有按钮的状态 + this.menuSelected = new bool[] { false, true }; + + // 将新选中的按钮设置为选中 + this.picIconStatus.BackgroundImage = (Bitmap) Resources.ResourceManager.GetObject("icon_status_selected", null); + this.labStatusText.ForeColor = ColorTranslator.FromHtml("#1296db"); + this.labStatusSelected.BackColor = ColorTranslator.FromHtml("#1296db"); + } + #endregion + + public RbFreqStdMeas() + { + InitializeComponent(); + } + + private void RbFreqStdMeas_Load(object sender, EventArgs e) + { + this.menuPics = new PictureBox[] { this.picIconHome, this.picIconStatus }; + this.menuLabels = new Label[] { this.labHomeText, this.labStatusText }; + this.menuUnderlines = new Label[] { this.labHomeSelected, this.labStatusSelected }; + this.menuIconResources = new string[] { "icon_home", "icon_status" }; + } + + private void btnExitSys_Click(object sender, EventArgs e) + { + Application.Exit(); + } + + private void btnExitSys_MouseHover(object sender, EventArgs e) + { + ToolTip p = new ToolTip(); + p.ShowAlways = true; + p.SetToolTip(this.btnExitSys, "退出"); + } + + private void panHome_Click(object sender, EventArgs e) + { + if (this.menuSelected[0] == false) + { + this.SelectHome(); + } + } + + private void panHome_MouseHover(object sender, EventArgs e) + { + // 没有选中首页时才动作 + if (this.menuSelected[0] == false) + { + HoverHome(); + } + } + + private void panHome_MouseLeave(object sender, EventArgs e) + { + // 没有选中首页时才动作 + if (this.menuSelected[0] == false) + { + LeaveHome(); + } + } + + private void panStatus_Click(object sender, EventArgs e) + { + if (this.menuSelected[1] == false) + { + SelectStatus(); + } + } + + private void panStatus_MouseHover(object sender, EventArgs e) + { + if (this.menuSelected[1] == false) + { + HoverStatus(); + } + + } + + private void panStatus_MouseLeave(object sender, EventArgs e) + { + if (this.menuSelected[1] == false) + { + LeaveStatus(); + } + } + } +} \ No newline at end of file diff --git a/RbFreqStandMeasure/RbFreqStdMeas.resx b/RbFreqStandMeasure/RbFreqStdMeas.resx new file mode 100644 index 0000000..1af7de1 --- /dev/null +++ b/RbFreqStandMeasure/RbFreqStdMeas.resx @@ -0,0 +1,120 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + \ No newline at end of file diff --git a/RbFreqStandMeasure/res/images/bg_banner.png b/RbFreqStandMeasure/res/images/bg_banner.png new file mode 100644 index 0000000..d795b7d --- /dev/null +++ b/RbFreqStandMeasure/res/images/bg_banner.png Binary files differ diff --git a/RbFreqStandMeasure/res/images/icon_exit.png b/RbFreqStandMeasure/res/images/icon_exit.png new file mode 100644 index 0000000..997b9e9 --- /dev/null +++ b/RbFreqStandMeasure/res/images/icon_exit.png Binary files differ diff --git a/RbFreqStandMeasure/res/images/icon_home.png b/RbFreqStandMeasure/res/images/icon_home.png new file mode 100644 index 0000000..f200f25 --- /dev/null +++ b/RbFreqStandMeasure/res/images/icon_home.png Binary files differ diff --git a/RbFreqStandMeasure/res/images/icon_home_selected.png b/RbFreqStandMeasure/res/images/icon_home_selected.png new file mode 100644 index 0000000..7a4feb4 --- /dev/null +++ b/RbFreqStandMeasure/res/images/icon_home_selected.png Binary files differ diff --git a/RbFreqStandMeasure/res/images/icon_status.png b/RbFreqStandMeasure/res/images/icon_status.png new file mode 100644 index 0000000..67bda58 --- /dev/null +++ b/RbFreqStandMeasure/res/images/icon_status.png Binary files differ diff --git a/RbFreqStandMeasure/res/images/icon_status_selected.png b/RbFreqStandMeasure/res/images/icon_status_selected.png new file mode 100644 index 0000000..12d7a1e --- /dev/null +++ b/RbFreqStandMeasure/res/images/icon_status_selected.png Binary files differ