Browse Source

调整回原界面

章政 7 years ago
parent
commit
1ad2028519
2 changed files with 140 additions and 194 deletions
  1. 140 131
      UAS-MES/Login.Designer.cs
  2. 0 63
      UAS-MES/Login.cs

+ 140 - 131
UAS-MES/Login.Designer.cs

@@ -29,37 +29,124 @@
         private void InitializeComponent()
         private void InitializeComponent()
         {
         {
             System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(Login));
             System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(Login));
+            this.UserName = new System.Windows.Forms.TextBox();
+            this.PassWord = new System.Windows.Forms.TextBox();
+            this.ForGetPwd = new System.Windows.Forms.LinkLabel();
+            this.label1 = new System.Windows.Forms.Label();
+            this.label2 = new System.Windows.Forms.Label();
+            this.panel1 = new System.Windows.Forms.Panel();
             this.label4 = new System.Windows.Forms.Label();
             this.label4 = new System.Windows.Forms.Label();
+            this.Source = new System.Windows.Forms.TextBox();
+            this.DB = new UAS_MES.CustomControl.ComBoxWithFocus.ComBoxWithFocus();
             this.label3 = new System.Windows.Forms.Label();
             this.label3 = new System.Windows.Forms.Label();
             this.LoginButton = new System.Windows.Forms.Button();
             this.LoginButton = new System.Windows.Forms.Button();
-            this.label2 = new System.Windows.Forms.Label();
-            this.label1 = new System.Windows.Forms.Label();
-            this.ForGetPwd = new System.Windows.Forms.LinkLabel();
-            this.ChineseTitle = new System.Windows.Forms.Label();
-            this.Source = new UAS_MES.CustomControl.TextBoxWithIcon.RoundTextBox();
-            this.PassWord = new UAS_MES.CustomControl.TextBoxWithIcon.RoundTextBox();
-            this.UserName = new UAS_MES.CustomControl.TextBoxWithIcon.RoundTextBox();
-            this.DB = new UAS_MES.CustomControl.ComBoxWithFocus.ComBoxWithFocus();
+            this.panel2 = new System.Windows.Forms.Panel();
+            this.label5 = new System.Windows.Forms.Label();
+            this.panel1.SuspendLayout();
+            this.panel2.SuspendLayout();
             this.SuspendLayout();
             this.SuspendLayout();
             // 
             // 
+            // UserName
+            // 
+            this.UserName.Location = new System.Drawing.Point(94, 62);
+            this.UserName.Margin = new System.Windows.Forms.Padding(3, 4, 3, 4);
+            this.UserName.Name = "UserName";
+            this.UserName.Size = new System.Drawing.Size(200, 23);
+            this.UserName.TabIndex = 0;
+            this.UserName.KeyDown += new System.Windows.Forms.KeyEventHandler(this.UserName_KeyDown);
+            // 
+            // PassWord
+            // 
+            this.PassWord.Location = new System.Drawing.Point(94, 107);
+            this.PassWord.Margin = new System.Windows.Forms.Padding(3, 4, 3, 4);
+            this.PassWord.Name = "PassWord";
+            this.PassWord.PasswordChar = '*';
+            this.PassWord.Size = new System.Drawing.Size(200, 23);
+            this.PassWord.TabIndex = 1;
+            this.PassWord.KeyDown += new System.Windows.Forms.KeyEventHandler(this.PassWord_KeyDown);
+            // 
+            // ForGetPwd
+            // 
+            this.ForGetPwd.AutoSize = true;
+            this.ForGetPwd.Location = new System.Drawing.Point(295, 66);
+            this.ForGetPwd.Name = "ForGetPwd";
+            this.ForGetPwd.Size = new System.Drawing.Size(68, 17);
+            this.ForGetPwd.TabIndex = 5;
+            this.ForGetPwd.TabStop = true;
+            this.ForGetPwd.Text = "忘记密码?";
+            this.ForGetPwd.LinkClicked += new System.Windows.Forms.LinkLabelLinkClickedEventHandler(this.ForGetPwd_LinkClicked);
+            // 
+            // label1
+            // 
+            this.label1.AutoSize = true;
+            this.label1.Location = new System.Drawing.Point(42, 66);
+            this.label1.Name = "label1";
+            this.label1.Size = new System.Drawing.Size(44, 17);
+            this.label1.TabIndex = 4;
+            this.label1.Text = "用户名";
+            // 
+            // label2
+            // 
+            this.label2.AutoSize = true;
+            this.label2.Location = new System.Drawing.Point(42, 111);
+            this.label2.Name = "label2";
+            this.label2.Size = new System.Drawing.Size(44, 17);
+            this.label2.TabIndex = 5;
+            this.label2.Text = "密   码";
+            // 
+            // panel1
+            // 
+            this.panel1.BackColor = System.Drawing.SystemColors.ButtonHighlight;
+            this.panel1.Controls.Add(this.label4);
+            this.panel1.Controls.Add(this.Source);
+            this.panel1.Controls.Add(this.DB);
+            this.panel1.Controls.Add(this.label3);
+            this.panel1.Controls.Add(this.LoginButton);
+            this.panel1.Controls.Add(this.panel2);
+            this.panel1.Controls.Add(this.UserName);
+            this.panel1.Controls.Add(this.ForGetPwd);
+            this.panel1.Controls.Add(this.PassWord);
+            this.panel1.Controls.Add(this.label2);
+            this.panel1.Controls.Add(this.label1);
+            this.panel1.Location = new System.Drawing.Point(164, 86);
+            this.panel1.Name = "panel1";
+            this.panel1.Size = new System.Drawing.Size(381, 297);
+            this.panel1.TabIndex = 9;
+            // 
             // label4
             // label4
             // 
             // 
             this.label4.AutoSize = true;
             this.label4.AutoSize = true;
-            this.label4.BackColor = System.Drawing.Color.Transparent;
-            this.label4.Location = new System.Drawing.Point(242, 245);
+            this.label4.Location = new System.Drawing.Point(42, 160);
             this.label4.Name = "label4";
             this.label4.Name = "label4";
             this.label4.Size = new System.Drawing.Size(44, 17);
             this.label4.Size = new System.Drawing.Size(44, 17);
-            this.label4.TabIndex = 24;
+            this.label4.TabIndex = 14;
             this.label4.Text = "资   源";
             this.label4.Text = "资   源";
             // 
             // 
+            // Source
+            // 
+            this.Source.Location = new System.Drawing.Point(94, 157);
+            this.Source.Margin = new System.Windows.Forms.Padding(3, 4, 3, 4);
+            this.Source.Name = "Source";
+            this.Source.Size = new System.Drawing.Size(200, 23);
+            this.Source.TabIndex = 2;
+            this.Source.KeyDown += new System.Windows.Forms.KeyEventHandler(this.Source_KeyDown);
+            // 
+            // DB
+            // 
+            this.DB.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
+            this.DB.FormattingEnabled = true;
+            this.DB.Location = new System.Drawing.Point(94, 204);
+            this.DB.Name = "DB";
+            this.DB.Size = new System.Drawing.Size(200, 25);
+            this.DB.TabIndex = 3;
+            // 
             // label3
             // label3
             // 
             // 
             this.label3.AutoSize = true;
             this.label3.AutoSize = true;
-            this.label3.BackColor = System.Drawing.Color.Transparent;
-            this.label3.Location = new System.Drawing.Point(242, 294);
+            this.label3.Location = new System.Drawing.Point(42, 209);
             this.label3.Name = "label3";
             this.label3.Name = "label3";
             this.label3.Size = new System.Drawing.Size(44, 17);
             this.label3.Size = new System.Drawing.Size(44, 17);
-            this.label3.TabIndex = 23;
+            this.label3.TabIndex = 11;
             this.label3.Text = "数据库";
             this.label3.Text = "数据库";
             // 
             // 
             // LoginButton
             // LoginButton
@@ -69,153 +156,75 @@
             this.LoginButton.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Stretch;
             this.LoginButton.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Stretch;
             this.LoginButton.Enabled = false;
             this.LoginButton.Enabled = false;
             this.LoginButton.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
             this.LoginButton.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
-            this.LoginButton.Location = new System.Drawing.Point(355, 341);
+            this.LoginButton.Location = new System.Drawing.Point(153, 250);
             this.LoginButton.Name = "LoginButton";
             this.LoginButton.Name = "LoginButton";
             this.LoginButton.Size = new System.Drawing.Size(75, 30);
             this.LoginButton.Size = new System.Drawing.Size(75, 30);
-            this.LoginButton.TabIndex = 19;
+            this.LoginButton.TabIndex = 4;
             this.LoginButton.Text = "登陆";
             this.LoginButton.Text = "登陆";
             this.LoginButton.UseVisualStyleBackColor = false;
             this.LoginButton.UseVisualStyleBackColor = false;
             this.LoginButton.Click += new System.EventHandler(this.LoginButton_Click);
             this.LoginButton.Click += new System.EventHandler(this.LoginButton_Click);
             // 
             // 
-            // label2
-            // 
-            this.label2.AutoSize = true;
-            this.label2.BackColor = System.Drawing.Color.Transparent;
-            this.label2.Location = new System.Drawing.Point(242, 203);
-            this.label2.Name = "label2";
-            this.label2.Size = new System.Drawing.Size(44, 17);
-            this.label2.TabIndex = 22;
-            this.label2.Text = "密   码";
-            // 
-            // label1
-            // 
-            this.label1.AutoSize = true;
-            this.label1.BackColor = System.Drawing.Color.Transparent;
-            this.label1.Location = new System.Drawing.Point(242, 155);
-            this.label1.Name = "label1";
-            this.label1.Size = new System.Drawing.Size(44, 17);
-            this.label1.TabIndex = 20;
-            this.label1.Text = "用户名";
+            // panel2
             // 
             // 
-            // ForGetPwd
+            this.panel2.BackColor = System.Drawing.SystemColors.ActiveCaption;
+            this.panel2.Controls.Add(this.label5);
+            this.panel2.Dock = System.Windows.Forms.DockStyle.Top;
+            this.panel2.Location = new System.Drawing.Point(0, 0);
+            this.panel2.Name = "panel2";
+            this.panel2.Size = new System.Drawing.Size(381, 33);
+            this.panel2.TabIndex = 6;
             // 
             // 
-            this.ForGetPwd.AutoSize = true;
-            this.ForGetPwd.BackColor = System.Drawing.Color.Transparent;
-            this.ForGetPwd.Location = new System.Drawing.Point(519, 153);
-            this.ForGetPwd.Name = "ForGetPwd";
-            this.ForGetPwd.Size = new System.Drawing.Size(68, 17);
-            this.ForGetPwd.TabIndex = 21;
-            this.ForGetPwd.TabStop = true;
-            this.ForGetPwd.Text = "忘记密码?";
-            this.ForGetPwd.LinkClicked += new System.Windows.Forms.LinkLabelLinkClickedEventHandler(this.ForGetPwd_LinkClicked);
+            // label5
             // 
             // 
-            // ChineseTitle
-            // 
-            this.ChineseTitle.AutoSize = true;
-            this.ChineseTitle.BackColor = System.Drawing.Color.Transparent;
-            this.ChineseTitle.Font = new System.Drawing.Font("微软雅黑", 18F);
-            this.ChineseTitle.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(6)))), ((int)(((byte)(60)))), ((int)(((byte)(130)))));
-            this.ChineseTitle.Location = new System.Drawing.Point(297, 98);
-            this.ChineseTitle.Name = "ChineseTitle";
-            this.ChineseTitle.Size = new System.Drawing.Size(207, 31);
-            this.ChineseTitle.TabIndex = 28;
-            this.ChineseTitle.Text = "UAS制造执行系统";
-            // 
-            // Source
-            // 
-            this.Source.BackColor = System.Drawing.Color.Transparent;
-            this.Source.Location = new System.Drawing.Point(303, 240);
-            this.Source.Margin = new System.Windows.Forms.Padding(3, 6, 3, 6);
-            this.Source.Name = "Source";
-            this.Source.PassWordChar = '\0';
-            this.Source.R = 7;
-            this.Source.Size = new System.Drawing.Size(200, 26);
-            this.Source.TabIndex = 27;
-            this.Source.UserKeyDown += new UAS_MES.CustomControl.TextBoxWithIcon.RoundTextBox.OnUserKeyDown(this.Source_KeyDown);
-            // 
-            // PassWord
-            // 
-            this.PassWord.BackColor = System.Drawing.Color.Transparent;
-            this.PassWord.Location = new System.Drawing.Point(303, 198);
-            this.PassWord.Margin = new System.Windows.Forms.Padding(3, 6, 3, 6);
-            this.PassWord.Name = "PassWord";
-            this.PassWord.PassWordChar = '*';
-            this.PassWord.R = 7;
-            this.PassWord.Size = new System.Drawing.Size(200, 26);
-            this.PassWord.TabIndex = 26;
-            this.PassWord.UserKeyDown += new UAS_MES.CustomControl.TextBoxWithIcon.RoundTextBox.OnUserKeyDown(this.PassWord_KeyDown);
-            // 
-            // UserName
-            // 
-            this.UserName.BackColor = System.Drawing.Color.Transparent;
-            this.UserName.Location = new System.Drawing.Point(303, 150);
-            this.UserName.Margin = new System.Windows.Forms.Padding(3, 4, 3, 4);
-            this.UserName.Name = "UserName";
-            this.UserName.PassWordChar = '\0';
-            this.UserName.R = 7;
-            this.UserName.Size = new System.Drawing.Size(200, 26);
-            this.UserName.TabIndex = 25;
-            this.UserName.UserKeyDown += new UAS_MES.CustomControl.TextBoxWithIcon.RoundTextBox.OnUserKeyDown(this.UserName_KeyDown);
-            // 
-            // DB
-            // 
-            this.DB.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
-            this.DB.FormattingEnabled = true;
-            this.DB.Location = new System.Drawing.Point(303, 289);
-            this.DB.Name = "DB";
-            this.DB.Size = new System.Drawing.Size(200, 25);
-            this.DB.TabIndex = 18;
+            this.label5.AutoSize = true;
+            this.label5.Font = new System.Drawing.Font("微软雅黑", 14F);
+            this.label5.ForeColor = System.Drawing.SystemColors.Desktop;
+            this.label5.Location = new System.Drawing.Point(3, 5);
+            this.label5.Name = "label5";
+            this.label5.Size = new System.Drawing.Size(164, 25);
+            this.label5.TabIndex = 0;
+            this.label5.Text = "UAS制造执行系统";
             // 
             // 
             // Login
             // Login
             // 
             // 
             this.AutoScaleDimensions = new System.Drawing.SizeF(7F, 17F);
             this.AutoScaleDimensions = new System.Drawing.SizeF(7F, 17F);
             this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
             this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
             this.BackColor = System.Drawing.SystemColors.Control;
             this.BackColor = System.Drawing.SystemColors.Control;
-            this.BackgroundImage = global::UAS_MES.Properties.Resources._5600c803afc2d;
+            this.BackgroundImage = global::UAS_MES.Properties.Resources.LoginBG;
             this.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Stretch;
             this.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Stretch;
-            this.ClientSize = new System.Drawing.Size(781, 445);
-            this.Controls.Add(this.ChineseTitle);
-            this.Controls.Add(this.Source);
-            this.Controls.Add(this.PassWord);
-            this.Controls.Add(this.UserName);
-            this.Controls.Add(this.label4);
-            this.Controls.Add(this.DB);
-            this.Controls.Add(this.label3);
-            this.Controls.Add(this.LoginButton);
-            this.Controls.Add(this.ForGetPwd);
-            this.Controls.Add(this.label2);
-            this.Controls.Add(this.label1);
-            this.DoubleBuffered = true;
-            this.Font = new System.Drawing.Font("微软雅黑", 9F);
-            this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.None;
+            this.ClientSize = new System.Drawing.Size(705, 461);
+            this.Controls.Add(this.panel1);
+            this.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
+            this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.SizableToolWindow;
             this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon")));
             this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon")));
             this.Margin = new System.Windows.Forms.Padding(3, 4, 3, 4);
             this.Margin = new System.Windows.Forms.Padding(3, 4, 3, 4);
             this.Name = "Login";
             this.Name = "Login";
             this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
             this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
             this.Tag = "ShowDialogWindow";
             this.Tag = "ShowDialogWindow";
-            this.Text = "UAS制造执行系统";
             this.FormClosing += new System.Windows.Forms.FormClosingEventHandler(this.Login_FormClosing);
             this.FormClosing += new System.Windows.Forms.FormClosingEventHandler(this.Login_FormClosing);
             this.Load += new System.EventHandler(this.Login_Load);
             this.Load += new System.EventHandler(this.Login_Load);
-            this.Paint += new System.Windows.Forms.PaintEventHandler(this.Login_Paint);
-            this.MouseDown += new System.Windows.Forms.MouseEventHandler(this.Login_MouseDown);
-            this.MouseMove += new System.Windows.Forms.MouseEventHandler(this.Login_MouseMove);
+            this.panel1.ResumeLayout(false);
+            this.panel1.PerformLayout();
+            this.panel2.ResumeLayout(false);
+            this.panel2.PerformLayout();
             this.ResumeLayout(false);
             this.ResumeLayout(false);
-            this.PerformLayout();
 
 
         }
         }
 
 
         #endregion
         #endregion
 
 
-        private CustomControl.TextBoxWithIcon.RoundTextBox Source;
-        private CustomControl.TextBoxWithIcon.RoundTextBox PassWord;
-        private CustomControl.TextBoxWithIcon.RoundTextBox UserName;
-        private System.Windows.Forms.Label label4;
+        private System.Windows.Forms.TextBox UserName;
+        private System.Windows.Forms.TextBox PassWord;
+        private System.Windows.Forms.LinkLabel ForGetPwd;
+        private System.Windows.Forms.Label label1;
+        private System.Windows.Forms.Label label2;
+        private System.Windows.Forms.Panel panel1;
+        private System.Windows.Forms.Panel panel2;
+        private System.Windows.Forms.Button LoginButton;
         private CustomControl.ComBoxWithFocus.ComBoxWithFocus DB;
         private CustomControl.ComBoxWithFocus.ComBoxWithFocus DB;
         private System.Windows.Forms.Label label3;
         private System.Windows.Forms.Label label3;
-        private System.Windows.Forms.Button LoginButton;
-        private System.Windows.Forms.Label label2;
-        private System.Windows.Forms.Label label1;
-        private System.Windows.Forms.LinkLabel ForGetPwd;
-        private System.Windows.Forms.Label ChineseTitle;
+        private System.Windows.Forms.Label label4;
+        private System.Windows.Forms.TextBox Source;
+        private System.Windows.Forms.Label label5;
     }
     }
 }
 }

+ 0 - 63
UAS-MES/Login.cs

@@ -8,9 +8,6 @@ using System.Security.Cryptography.X509Certificates;
 using System.Net;
 using System.Net;
 using System.Net.Sockets;
 using System.Net.Sockets;
 using System.Threading;
 using System.Threading;
-using System.Drawing.Drawing2D;
-using System.Drawing;
-using UAS_MES.Properties;
 
 
 namespace UAS_MES
 namespace UAS_MES
 {
 {
@@ -24,8 +21,6 @@ namespace UAS_MES
         //注销的时候会重新生成这边变量,所以需要用static
         //注销的时候会重新生成这边变量,所以需要用static
         static LogicHandler lgc;
         static LogicHandler lgc;
 
 
-        int Close_Size = 24;
-
         Thread LoadMasterInf;
         Thread LoadMasterInf;
 
 
         public Login()
         public Login()
@@ -230,63 +225,5 @@ namespace UAS_MES
             if (e.KeyCode == Keys.Enter)
             if (e.KeyCode == Keys.Enter)
                 PassWord.Focus();
                 PassWord.Focus();
         }
         }
-
-        private void Login_Paint(object sender, PaintEventArgs e)
-        {
-            //简单的画一个浅蓝色的背景
-            Graphics gra = e.Graphics;
-            //绘制背景框
-            int startheight = 65;
-            int startwidth = 100;
-            int boxheight = 330;
-            Rectangle Rect = new Rectangle(startwidth, startheight, Width - startwidth * 2 - 5, boxheight);
-            LinearGradientBrush Bru = new LinearGradientBrush(Rect, Color.FromArgb(125, Color.WhiteSmoke), Color.FromArgb(229, 237, 248), LinearGradientMode.Vertical);
-            gra.FillRectangle(Bru, Rect);
-            Pen ArcPen = new Pen(Color.FromArgb(77, 109, 148), 3);
-            int R = 14;
-            GraphicsPath path = new GraphicsPath();
-            gra.SmoothingMode = SmoothingMode.HighQuality;
-            path.AddArc(startwidth, startheight - 3, R, R, 180, 90);
-            path.AddArc(this.Width - startwidth - 19, startheight - 3, R, R, -90, 90);
-            path.AddArc(this.Width - startwidth - 19, startheight + boxheight - R, R, R, 0, 90);
-            path.AddArc(startwidth, startheight + boxheight - R, R, R, 90, 90);
-            path.CloseFigure();
-            gra.DrawPath(ArcPen, path);
-
-            Bitmap image = Resources.dialog_close_24px_1173781_easyicon_net;
-            Rectangle rect = this.ClientRectangle;
-            //画关闭符号
-            using (Pen objpen = new Pen(Color.Black))
-            {
-                //使用图片
-                Bitmap bt = new Bitmap(image);
-                Point p5 = new Point(Width-Close_Size-4, 4);
-                e.Graphics.DrawImage(bt, p5);
-            }
-        }
-
-        private Point offset;
-        private void Login_MouseDown(object sender, MouseEventArgs e)
-        {
-            if (MouseButtons.Left != e.Button) return;
-            Point cur = this.PointToScreen(e.Location);
-            offset = new Point(cur.X - this.Left, cur.Y - this.Top);
-
-            Rectangle rect = this.ClientRectangle;
-            rect.Offset(Width - Close_Size - 4, 4);
-            rect.Width = Close_Size;
-            rect.Height = Close_Size;
-            int x = e.X, y = e.Y;
-            bool isClose = x > rect.X && x < rect.Right && y > rect.Y && y < rect.Bottom;
-            if (isClose)
-                Close();
-        }
-
-        private void Login_MouseMove(object sender, MouseEventArgs e)
-        {
-            if (MouseButtons.Left != e.Button) return;
-            Point cur = MousePosition;
-            this.Location = new Point(cur.X - offset.X, cur.Y - offset.Y);
-        }
     }
     }
 }
 }