diff --git a/Final/Final/Form1.Designer.cs b/Final/Final/Form1.Designer.cs index a354bf5..0a6057a 100644 --- a/Final/Final/Form1.Designer.cs +++ b/Final/Final/Form1.Designer.cs @@ -36,8 +36,9 @@ namespace Final button1 = new Button(); listBox1 = new ListBox(); tabPage2 = new TabPage(); + l = new Label(); + button6 = new Button(); button5 = new Button(); - textBox1 = new TextBox(); textBoxH = new TextBox(); textBoxW = new TextBox(); button4 = new Button(); @@ -45,6 +46,8 @@ namespace Final listBox2 = new ListBox(); pictureBox1 = new PictureBox(); tabPage3 = new TabPage(); + colorDialog = new ColorDialog(); + colorDialog1 = new ColorDialog(); tabControl1.SuspendLayout(); tabPage1.SuspendLayout(); tabPage2.SuspendLayout(); @@ -106,8 +109,9 @@ namespace Final // // tabPage2 // + tabPage2.Controls.Add(l); + tabPage2.Controls.Add(button6); tabPage2.Controls.Add(button5); - tabPage2.Controls.Add(textBox1); tabPage2.Controls.Add(textBoxH); tabPage2.Controls.Add(textBoxW); tabPage2.Controls.Add(button4); @@ -122,23 +126,37 @@ namespace Final tabPage2.Text = "1 задание"; tabPage2.UseVisualStyleBackColor = true; // + // l + // + l.AutoSize = true; + l.BackColor = Color.White; + l.Location = new Point(40, 167); + l.MaximumSize = new Size(100, 100); + l.Name = "l"; + l.Size = new Size(97, 50); + l.TabIndex = 11; + l.Text = " "; + // + // button6 + // + button6.Location = new Point(168, 167); + button6.Name = "button6"; + button6.Size = new Size(176, 34); + button6.TabIndex = 10; + button6.Text = "Выбор цвета"; + button6.UseVisualStyleBackColor = true; + button6.Click += button6_Click; + // // button5 // button5.Location = new Point(918, 470); button5.Name = "button5"; button5.Size = new Size(138, 62); button5.TabIndex = 9; - button5.Text = "Квадрат с овалом"; + button5.Text = "Загрузить"; button5.UseVisualStyleBackColor = true; button5.Click += button5_Click; // - // textBox1 - // - textBox1.Location = new Point(168, 172); - textBox1.Name = "textBox1"; - textBox1.Size = new Size(299, 31); - textBox1.TabIndex = 8; - // // textBoxH // textBoxH.Location = new Point(168, 101); @@ -177,9 +195,9 @@ namespace Final // listBox2.FormattingEnabled = true; listBox2.ItemHeight = 25; - listBox2.Location = new Point(9, 470); + listBox2.Location = new Point(6, 257); listBox2.Name = "listBox2"; - listBox2.Size = new Size(519, 129); + listBox2.Size = new Size(461, 304); listBox2.TabIndex = 1; // // pictureBox1 @@ -205,6 +223,7 @@ namespace Final // AutoScaleDimensions = new SizeF(10F, 25F); AutoScaleMode = AutoScaleMode.Font; + BackColor = SystemColors.ControlDarkDark; ClientSize = new Size(1158, 667); Controls.Add(tabControl1); Name = "Form1"; @@ -232,7 +251,10 @@ namespace Final private Button button4; private TextBox textBoxH; private TextBox textBoxW; - private TextBox textBox1; private Button button5; + private ColorDialog colorDialog; + private Button button6; + private Label l; + private ColorDialog colorDialog1; } } \ No newline at end of file diff --git a/Final/Final/Form1.cs b/Final/Final/Form1.cs index bb01fc2..80c1985 100644 --- a/Final/Final/Form1.cs +++ b/Final/Final/Form1.cs @@ -106,6 +106,18 @@ namespace Final MessageBox.Show(", ."); } } + + private void button6_Click(object sender, EventArgs e) + { + using (ColorDialog colorDialog = new ColorDialog()) + { + if (colorDialog.ShowDialog() == DialogResult.OK) + { + selectedColor = colorDialog.Color; + l.BackColor = selectedColor; + } + } + } } diff --git a/Final/Final/Form1.resx b/Final/Final/Form1.resx index af32865..82b407d 100644 --- a/Final/Final/Form1.resx +++ b/Final/Final/Form1.resx @@ -117,4 +117,10 @@ System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + 17, 17 + + + 176, 17 + \ No newline at end of file