Browse Source

添加切选选择焦点

章政 8 years ago
parent
commit
07d10b4a1f
2 changed files with 18 additions and 11 deletions
  1. 11 10
      UAS-MES/Login.Designer.cs
  2. 7 1
      UAS-MES/Login.cs

+ 11 - 10
UAS-MES/Login.Designer.cs

@@ -52,8 +52,9 @@
             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.Size = new System.Drawing.Size(200, 27);
             this.UserName.TabIndex = 0;
+            this.UserName.KeyDown += new System.Windows.Forms.KeyEventHandler(this.UserName_KeyDown);
             // 
             // PassWord
             // 
@@ -61,7 +62,7 @@
             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.Size = new System.Drawing.Size(200, 27);
             this.PassWord.TabIndex = 1;
             this.PassWord.KeyDown += new System.Windows.Forms.KeyEventHandler(this.PassWord_KeyDown);
             // 
@@ -70,7 +71,7 @@
             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.Size = new System.Drawing.Size(84, 20);
             this.ForGetPwd.TabIndex = 5;
             this.ForGetPwd.TabStop = true;
             this.ForGetPwd.Text = "忘记密码?";
@@ -81,7 +82,7 @@
             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.Size = new System.Drawing.Size(54, 20);
             this.label1.TabIndex = 4;
             this.label1.Text = "用户名";
             // 
@@ -90,7 +91,7 @@
             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.Size = new System.Drawing.Size(51, 20);
             this.label2.TabIndex = 5;
             this.label2.Text = "密   码";
             // 
@@ -118,7 +119,7 @@
             this.label4.AutoSize = true;
             this.label4.Location = new System.Drawing.Point(42, 160);
             this.label4.Name = "label4";
-            this.label4.Size = new System.Drawing.Size(44, 17);
+            this.label4.Size = new System.Drawing.Size(51, 20);
             this.label4.TabIndex = 14;
             this.label4.Text = "资   源";
             // 
@@ -127,7 +128,7 @@
             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.Size = new System.Drawing.Size(200, 27);
             this.Source.TabIndex = 2;
             this.Source.KeyDown += new System.Windows.Forms.KeyEventHandler(this.Source_KeyDown);
             // 
@@ -137,7 +138,7 @@
             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.Size = new System.Drawing.Size(200, 28);
             this.DB.TabIndex = 3;
             // 
             // label3
@@ -145,7 +146,7 @@
             this.label3.AutoSize = true;
             this.label3.Location = new System.Drawing.Point(42, 209);
             this.label3.Name = "label3";
-            this.label3.Size = new System.Drawing.Size(44, 17);
+            this.label3.Size = new System.Drawing.Size(54, 20);
             this.label3.TabIndex = 11;
             this.label3.Text = "数据库";
             // 
@@ -185,7 +186,7 @@
             // 
             // Login
             // 
-            this.AutoScaleDimensions = new System.Drawing.SizeF(7F, 17F);
+            this.AutoScaleDimensions = new System.Drawing.SizeF(9F, 20F);
             this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
             this.BackColor = System.Drawing.SystemColors.Control;
             this.BackgroundImage = global::UAS_MES.Properties.Resources.LoginBG;

+ 7 - 1
UAS-MES/Login.cs

@@ -188,7 +188,7 @@ namespace UAS_MES
         private void PassWord_KeyDown(object sender, KeyEventArgs e)
         {
             if (e.KeyCode == Keys.Enter)
-                LoginButton.PerformClick();
+                Source.Focus();
         }
 
         /// <summary>
@@ -226,5 +226,11 @@ namespace UAS_MES
 
             }
         }
+
+        private void UserName_KeyDown(object sender, KeyEventArgs e)
+        {
+            if (e.KeyCode == Keys.Enter)
+                PassWord.Focus();
+        }
     }
 }