Browse Source

переход по кнопкам по теме автомобиль

Kuzmenco 1 year ago
parent
commit
cebc2060b9
3 changed files with 34 additions and 3 deletions
  1. 3 1
      Form1.cs
  2. 17 2
      Form2.Designer.cs
  3. 14 0
      Form2.cs

+ 3 - 1
Form1.cs

@@ -20,7 +20,9 @@ namespace ПрокатАвто03
 
         private void button1_Click(object sender, EventArgs e)
         {
-
+            Form2 fr2 = new Form2();
+            fr2.Show();
+            Hide();
         }
 
         private void label1_Click(object sender, EventArgs e)

+ 17 - 2
Form2.Designer.cs

@@ -34,6 +34,7 @@ namespace ПрокатАвто03
             this.button1 = new System.Windows.Forms.Button();
             this.button2 = new System.Windows.Forms.Button();
             this.button3 = new System.Windows.Forms.Button();
+            this.button4 = new System.Windows.Forms.Button();
             ((System.ComponentModel.ISupportInitialize)(this.dataGridView1)).BeginInit();
             this.SuspendLayout();
             // 
@@ -41,7 +42,7 @@ namespace ПрокатАвто03
             // 
             this.label1.AutoSize = true;
             this.label1.Font = new System.Drawing.Font("Times New Roman", 15.75F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(204)));
-            this.label1.Location = new System.Drawing.Point(170, -1);
+            this.label1.Location = new System.Drawing.Point(177, 9);
             this.label1.Name = "label1";
             this.label1.Size = new System.Drawing.Size(210, 24);
             this.label1.TabIndex = 0;
@@ -51,7 +52,7 @@ namespace ПрокатАвто03
             // dataGridView1
             // 
             this.dataGridView1.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize;
-            this.dataGridView1.Location = new System.Drawing.Point(42, 26);
+            this.dataGridView1.Location = new System.Drawing.Point(42, 38);
             this.dataGridView1.Name = "dataGridView1";
             this.dataGridView1.Size = new System.Drawing.Size(467, 188);
             this.dataGridView1.TabIndex = 1;
@@ -65,6 +66,7 @@ namespace ПрокатАвто03
             this.button1.TabIndex = 2;
             this.button1.Text = "добавлять";
             this.button1.UseVisualStyleBackColor = true;
+            this.button1.Click += new System.EventHandler(this.button1_Click);
             // 
             // button2
             // 
@@ -86,12 +88,24 @@ namespace ПрокатАвто03
             this.button3.Text = "редактирование";
             this.button3.UseVisualStyleBackColor = true;
             // 
+            // button4
+            // 
+            this.button4.Font = new System.Drawing.Font("Times New Roman", 9.75F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
+            this.button4.Location = new System.Drawing.Point(12, 9);
+            this.button4.Name = "button4";
+            this.button4.Size = new System.Drawing.Size(75, 23);
+            this.button4.TabIndex = 5;
+            this.button4.Text = "назад";
+            this.button4.UseVisualStyleBackColor = true;
+            this.button4.Click += new System.EventHandler(this.button4_Click);
+            // 
             // Form2
             // 
             this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
             this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
             this.BackColor = System.Drawing.Color.Teal;
             this.ClientSize = new System.Drawing.Size(545, 284);
+            this.Controls.Add(this.button4);
             this.Controls.Add(this.button3);
             this.Controls.Add(this.button2);
             this.Controls.Add(this.button1);
@@ -112,5 +126,6 @@ namespace ПрокатАвто03
         private System.Windows.Forms.Button button1;
         private System.Windows.Forms.Button button2;
         private System.Windows.Forms.Button button3;
+        private System.Windows.Forms.Button button4;
     }
 }

+ 14 - 0
Form2.cs

@@ -21,5 +21,19 @@ namespace ПрокатАвто03
         {
 
         }
+
+        private void button4_Click(object sender, EventArgs e)
+        {
+            Form1 fr1 = new Form1();
+            fr1.Show();
+            Hide();
+        }
+
+        private void button1_Click(object sender, EventArgs e)
+        {
+            Form3 fr3 = new Form3();
+            fr3.Show();
+           
+        }
     }
 }