diff --git a/Final/Final.sln b/Final/Final.sln new file mode 100644 index 0000000..a019d23 --- /dev/null +++ b/Final/Final.sln @@ -0,0 +1,25 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio Version 17 +VisualStudioVersion = 17.7.34024.191 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Final", "Final\Final.csproj", "{C0A1E0DC-D774-4D9A-B23D-205C6BE006C0}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {C0A1E0DC-D774-4D9A-B23D-205C6BE006C0}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {C0A1E0DC-D774-4D9A-B23D-205C6BE006C0}.Debug|Any CPU.Build.0 = Debug|Any CPU + {C0A1E0DC-D774-4D9A-B23D-205C6BE006C0}.Release|Any CPU.ActiveCfg = Release|Any CPU + {C0A1E0DC-D774-4D9A-B23D-205C6BE006C0}.Release|Any CPU.Build.0 = Release|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + SolutionGuid = {22CF9810-CF49-403F-A1D3-A0A5FDAC4125} + EndGlobalSection +EndGlobal diff --git a/Final/Final/Final.csproj b/Final/Final/Final.csproj new file mode 100644 index 0000000..e1a0735 --- /dev/null +++ b/Final/Final/Final.csproj @@ -0,0 +1,11 @@ + + + + WinExe + net7.0-windows + enable + true + enable + + + \ No newline at end of file diff --git a/Final/Final/Form1.Designer.cs b/Final/Final/Form1.Designer.cs new file mode 100644 index 0000000..4532390 --- /dev/null +++ b/Final/Final/Form1.Designer.cs @@ -0,0 +1,138 @@ +namespace Final +{ + partial class Form1 + { + /// + /// Required designer variable. + /// + private System.ComponentModel.IContainer components = null; + + /// + /// Clean up any resources being used. + /// + /// true if managed resources should be disposed; otherwise, false. + protected override void Dispose(bool disposing) + { + if (disposing && (components != null)) + { + components.Dispose(); + } + base.Dispose(disposing); + } + + #region Windows Form Designer generated code + + /// + /// Required method for Designer support - do not modify + /// the contents of this method with the code editor. + /// + private void InitializeComponent() + { + tabControl1 = new TabControl(); + tabPage1 = new TabPage(); + button2 = new Button(); + button1 = new Button(); + listBox1 = new ListBox(); + tabPage2 = new TabPage(); + tabPage3 = new TabPage(); + tabControl1.SuspendLayout(); + tabPage1.SuspendLayout(); + SuspendLayout(); + // + // tabControl1 + // + tabControl1.Controls.Add(tabPage1); + tabControl1.Controls.Add(tabPage2); + tabControl1.Controls.Add(tabPage3); + tabControl1.Location = new Point(-1, -1); + tabControl1.Name = "tabControl1"; + tabControl1.SelectedIndex = 0; + tabControl1.Size = new Size(1154, 666); + tabControl1.TabIndex = 0; + // + // tabPage1 + // + tabPage1.Controls.Add(button2); + tabPage1.Controls.Add(button1); + tabPage1.Controls.Add(listBox1); + tabPage1.Location = new Point(4, 34); + tabPage1.Name = "tabPage1"; + tabPage1.Padding = new Padding(3); + tabPage1.Size = new Size(1146, 628); + tabPage1.TabIndex = 0; + tabPage1.Text = "Задание 1"; + tabPage1.UseVisualStyleBackColor = true; + // + // button2 + // + button2.Location = new Point(223, 417); + button2.Name = "button2"; + button2.Size = new Size(112, 106); + button2.TabIndex = 7; + button2.Text = "button2"; + button2.UseVisualStyleBackColor = true; + button2.Click += button2_Click; + // + // button1 + // + button1.Location = new Point(18, 417); + button1.Name = "button1"; + button1.Size = new Size(112, 106); + button1.TabIndex = 6; + button1.Text = "button1"; + button1.UseVisualStyleBackColor = true; + button1.Click += button1_Click; + // + // listBox1 + // + listBox1.FormattingEnabled = true; + listBox1.ItemHeight = 25; + listBox1.Location = new Point(492, 18); + listBox1.Name = "listBox1"; + listBox1.Size = new Size(648, 579); + listBox1.TabIndex = 0; + // + // tabPage2 + // + tabPage2.Location = new Point(4, 34); + tabPage2.Name = "tabPage2"; + tabPage2.Padding = new Padding(3); + tabPage2.Size = new Size(1146, 628); + tabPage2.TabIndex = 1; + tabPage2.Text = "1 задание"; + tabPage2.UseVisualStyleBackColor = true; + // + // tabPage3 + // + tabPage3.Location = new Point(4, 34); + tabPage3.Name = "tabPage3"; + tabPage3.Padding = new Padding(3); + tabPage3.Size = new Size(1146, 628); + tabPage3.TabIndex = 2; + tabPage3.Text = "tabPage3"; + tabPage3.UseVisualStyleBackColor = true; + // + // Form1 + // + AutoScaleDimensions = new SizeF(10F, 25F); + AutoScaleMode = AutoScaleMode.Font; + ClientSize = new Size(1158, 667); + Controls.Add(tabControl1); + Name = "Form1"; + Text = "Form1"; + tabControl1.ResumeLayout(false); + tabPage1.ResumeLayout(false); + ResumeLayout(false); + } + + #endregion + + private TabControl tabControl1; + private TabPage tabPage1; + private TabPage tabPage2; + private ListBox listBox1; + private Button button2; + private Button button1; + private TabPage tabPage3; + } +} \ No newline at end of file diff --git a/Final/Final/Form1.cs b/Final/Final/Form1.cs new file mode 100644 index 0000000..ba8bac9 --- /dev/null +++ b/Final/Final/Form1.cs @@ -0,0 +1,40 @@ +namespace Final +{ + public partial class Form1 : Form + { + + + List ones; + + public Form1() + { + + ones = new List(); + + InitializeComponent(); + } + + private void button1_Click(object sender, EventArgs e) + { + try + { + One one = new One("Wood", "Queen", "White", 549.99); + ones.Add(one); + } + + catch (Exception ex) + { + MessageBox.Show(ex.Message); + } + } + + private void button2_Click(object sender, EventArgs e) + { + listBox1.Items.Clear(); + for (int i = 0; i < ones.Count; i++) + { + listBox1.Items.Add(ones[i].ToString()); + } + } + } +} \ No newline at end of file diff --git a/Final/Final/Form1.resx b/Final/Final/Form1.resx new file mode 100644 index 0000000..af32865 --- /dev/null +++ b/Final/Final/Form1.resx @@ -0,0 +1,120 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + \ No newline at end of file diff --git a/Final/Final/One.cs b/Final/Final/One.cs new file mode 100644 index 0000000..cc37ce5 --- /dev/null +++ b/Final/Final/One.cs @@ -0,0 +1,37 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace Final; + +public class One +{ + + public string Material; // Материал, из которого сделана кровать + public string Size; // Размер кровати (например, "Queen", "King", "Single") + public string Color; // Цвет кровати + public double Price; // Цена кровати + + // Конструктор по умолчанию + public One() { } + + // Конструктор с параметрами + public One(string material, string size, string color, double price) + { + Material = material; + Size = size; + Color = color; + Price = price; + } + public override string ToString() + { + return "Диван << " + "Материал : " + Material + "; " + + "Цвет : " + Color + "; " + + "Размер : " + Size + "; " + + "Цена: " +Price+ " >>"; + + } + +} diff --git a/Final/Final/Program.cs b/Final/Final/Program.cs new file mode 100644 index 0000000..1d91f26 --- /dev/null +++ b/Final/Final/Program.cs @@ -0,0 +1,17 @@ +namespace Final +{ + internal static class Program + { + /// + /// The main entry point for the application. + /// + [STAThread] + static void Main() + { + // To customize application configuration such as set high DPI settings or default font, + // see https://aka.ms/applicationconfiguration. + ApplicationConfiguration.Initialize(); + Application.Run(new Form1()); + } + } +} \ No newline at end of file