chernyshyov.2000 vor 5 Jahren
Ursprung
Commit
911280f802
2 geänderte Dateien mit 51 neuen und 7 gelöschten Zeilen
  1. 14 5
      konkurs/Form1.Designer.cs
  2. 37 2
      konkurs/Form1.cs

+ 14 - 5
konkurs/Form1.Designer.cs

@@ -35,27 +35,36 @@
             // 
             // button2
             // 
-            this.button2.Location = new System.Drawing.Point(550, 268);
+            this.button2.Location = new System.Drawing.Point(466, 261);
             this.button2.Name = "button2";
-            this.button2.Size = new System.Drawing.Size(75, 23);
+            this.button2.Size = new System.Drawing.Size(169, 33);
             this.button2.TabIndex = 1;
-            this.button2.Text = "button2";
+            this.button2.Text = "войти";
             this.button2.UseVisualStyleBackColor = true;
             this.button2.Click += new System.EventHandler(this.button2_Click);
             // 
             // textBox1
             // 
-            this.textBox1.Location = new System.Drawing.Point(372, 146);
+            this.textBox1.Location = new System.Drawing.Point(371, 183);
             this.textBox1.Name = "textBox1";
             this.textBox1.Size = new System.Drawing.Size(160, 20);
             this.textBox1.TabIndex = 2;
+            this.textBox1.Text = "введите логин";
+            this.textBox1.TextAlign = System.Windows.Forms.HorizontalAlignment.Center;
+            this.textBox1.TextChanged += new System.EventHandler(this.textBox1_TextChanged);
+            this.textBox1.Enter += new System.EventHandler(this.textBox1_Enter);
+            this.textBox1.Leave += new System.EventHandler(this.textBox1_Leave);
             // 
             // textBox2
             // 
-            this.textBox2.Location = new System.Drawing.Point(610, 146);
+            this.textBox2.Location = new System.Drawing.Point(568, 183);
             this.textBox2.Name = "textBox2";
             this.textBox2.Size = new System.Drawing.Size(165, 20);
             this.textBox2.TabIndex = 3;
+            this.textBox2.Text = "введите пароль";
+            this.textBox2.TextAlign = System.Windows.Forms.HorizontalAlignment.Center;
+            this.textBox2.Enter += new System.EventHandler(this.textBox2_Enter);
+            this.textBox2.Leave += new System.EventHandler(this.textBox2_Leave);
             // 
             // Form1
             // 

+ 37 - 2
konkurs/Form1.cs

@@ -58,7 +58,42 @@ namespace konkurs
                     sqlReader.Close();
             }
         }
-    
-            
+
+        private void textBox1_TextChanged(object sender, EventArgs e)
+        {
+
+        }
+
+        private void textBox1_Enter(object sender, EventArgs e)
+        {
+            if(textBox1.Text == "введите логин")
+            {
+                textBox1.Text = "";
+            }
+        }
+
+        private void textBox1_Leave(object sender, EventArgs e)
+        {
+            if (textBox1.Text == "")
+            {
+                textBox1.Text = "введите логин";
+            }
+        }
+
+        private void textBox2_Enter(object sender, EventArgs e)
+        {
+            if (textBox2.Text == "введите пароль")
+            {
+                textBox2.Text = "";
+            }
         }
+
+        private void textBox2_Leave(object sender, EventArgs e)
+        {
+            if (textBox2.Text == "")
+            {
+                textBox2.Text = "введите пароль";
+            }
+        }
+    }
     }