commit f15d814111fa95ac74d33168ca45b4c2cfe41a01 Author: Your Name Date: Fri Nov 28 18:19:30 2025 +0400 calc1 diff --git a/.vs/Calculator/FileContentIndex/f3fc9ba3-841a-4619-8332-b025368f654c.vsidx b/.vs/Calculator/FileContentIndex/f3fc9ba3-841a-4619-8332-b025368f654c.vsidx new file mode 100644 index 0000000..5cdce9f Binary files /dev/null and b/.vs/Calculator/FileContentIndex/f3fc9ba3-841a-4619-8332-b025368f654c.vsidx differ diff --git a/.vs/Calculator/v17/.suo b/.vs/Calculator/v17/.suo new file mode 100644 index 0000000..bc72634 Binary files /dev/null and b/.vs/Calculator/v17/.suo differ diff --git a/App.config b/App.config new file mode 100644 index 0000000..56efbc7 --- /dev/null +++ b/App.config @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/Calculator.csproj b/Calculator.csproj new file mode 100644 index 0000000..afc653b --- /dev/null +++ b/Calculator.csproj @@ -0,0 +1,89 @@ + + + + + Debug + AnyCPU + {E4720E95-9A7C-467C-A8CB-79023BA507E8} + WinExe + Calculator + Calculator + v4.7.2 + 512 + true + true + + + AnyCPU + true + full + false + bin\Debug\ + DEBUG;TRACE + prompt + 4 + + + AnyCPU + pdbonly + true + bin\Release\ + TRACE + prompt + 4 + + + + C:\Users\Student\Downloads\AnalaizerClass (2).dll + + + C:\Users\Student\Downloads\CalcClass.dll + + + + + + + + + + + + + + + + Form + + + Form1.cs + + + + + Form1.cs + + + ResXFileCodeGenerator + Resources.Designer.cs + Designer + + + True + Resources.resx + + + SettingsSingleFileGenerator + Settings.Designer.cs + + + True + Settings.settings + True + + + + + + + \ No newline at end of file diff --git a/Calculator.sln b/Calculator.sln new file mode 100644 index 0000000..ce91a52 --- /dev/null +++ b/Calculator.sln @@ -0,0 +1,25 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio Version 17 +VisualStudioVersion = 17.8.34511.84 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Calculator", "Calculator.csproj", "{E4720E95-9A7C-467C-A8CB-79023BA507E8}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {E4720E95-9A7C-467C-A8CB-79023BA507E8}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {E4720E95-9A7C-467C-A8CB-79023BA507E8}.Debug|Any CPU.Build.0 = Debug|Any CPU + {E4720E95-9A7C-467C-A8CB-79023BA507E8}.Release|Any CPU.ActiveCfg = Release|Any CPU + {E4720E95-9A7C-467C-A8CB-79023BA507E8}.Release|Any CPU.Build.0 = Release|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + SolutionGuid = {18F5209C-8FED-4525-ABA1-8AFD63CB618D} + EndGlobalSection +EndGlobal diff --git a/Form1.Designer.cs b/Form1.Designer.cs new file mode 100644 index 0000000..9fd8312 --- /dev/null +++ b/Form1.Designer.cs @@ -0,0 +1,495 @@ +namespace Calculator +{ + partial class Form1 + { + /// + /// Обязательная переменная конструктора. + /// + private System.ComponentModel.IContainer components = null; + + /// + /// Освободить все используемые ресурсы. + /// + /// истинно, если управляемый ресурс должен быть удален; иначе ложно. + protected override void Dispose(bool disposing) + { + if (disposing && (components != null)) + { + components.Dispose(); + } + base.Dispose(disposing); + } + + #region Код, автоматически созданный конструктором форм Windows + + /// + /// Требуемый метод для поддержки конструктора — не изменяйте + /// содержимое этого метода с помощью редактора кода. + /// + private void InitializeComponent() + { + 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(); + this.button5 = new System.Windows.Forms.Button(); + this.button6 = new System.Windows.Forms.Button(); + this.button7 = new System.Windows.Forms.Button(); + this.button8 = new System.Windows.Forms.Button(); + this.button9 = new System.Windows.Forms.Button(); + this.button10 = new System.Windows.Forms.Button(); + this.button11 = new System.Windows.Forms.Button(); + this.button12 = new System.Windows.Forms.Button(); + this.button13 = new System.Windows.Forms.Button(); + this.button14 = new System.Windows.Forms.Button(); + this.textBox1 = new System.Windows.Forms.TextBox(); + this.textBox2 = new System.Windows.Forms.TextBox(); + this.label2 = new System.Windows.Forms.Label(); + this.label3 = new System.Windows.Forms.Label(); + this.button15 = new System.Windows.Forms.Button(); + this.button16 = new System.Windows.Forms.Button(); + this.button17 = new System.Windows.Forms.Button(); + this.button19 = new System.Windows.Forms.Button(); + this.button20 = new System.Windows.Forms.Button(); + this.button21 = new System.Windows.Forms.Button(); + this.button22 = new System.Windows.Forms.Button(); + this.button23 = new System.Windows.Forms.Button(); + this.button24 = new System.Windows.Forms.Button(); + this.button25 = new System.Windows.Forms.Button(); + this.button26 = new System.Windows.Forms.Button(); + this.SuspendLayout(); + // + // button1 + // + this.button1.BackColor = System.Drawing.Color.LightPink; + this.button1.FlatStyle = System.Windows.Forms.FlatStyle.Popup; + this.button1.Location = new System.Drawing.Point(71, 178); + this.button1.Name = "button1"; + this.button1.Size = new System.Drawing.Size(94, 64); + this.button1.TabIndex = 0; + this.button1.Text = "1"; + this.button1.UseVisualStyleBackColor = false; + this.button1.Click += new System.EventHandler(this.button1_Click); + // + // button2 + // + this.button2.BackColor = System.Drawing.Color.LightPink; + this.button2.FlatStyle = System.Windows.Forms.FlatStyle.Popup; + this.button2.Location = new System.Drawing.Point(191, 178); + this.button2.Name = "button2"; + this.button2.Size = new System.Drawing.Size(94, 64); + this.button2.TabIndex = 1; + this.button2.Text = "2"; + this.button2.UseVisualStyleBackColor = false; + this.button2.Click += new System.EventHandler(this.button2_Click); + // + // button3 + // + this.button3.BackColor = System.Drawing.Color.LightPink; + this.button3.FlatStyle = System.Windows.Forms.FlatStyle.Popup; + this.button3.ForeColor = System.Drawing.SystemColors.ActiveCaptionText; + this.button3.Location = new System.Drawing.Point(315, 178); + this.button3.Name = "button3"; + this.button3.Size = new System.Drawing.Size(94, 64); + this.button3.TabIndex = 2; + this.button3.Text = "3"; + this.button3.UseVisualStyleBackColor = false; + this.button3.Click += new System.EventHandler(this.button3_Click); + // + // button4 + // + this.button4.BackColor = System.Drawing.Color.LightPink; + this.button4.FlatStyle = System.Windows.Forms.FlatStyle.Popup; + this.button4.Location = new System.Drawing.Point(71, 268); + this.button4.Name = "button4"; + this.button4.Size = new System.Drawing.Size(94, 64); + this.button4.TabIndex = 3; + this.button4.Text = "4"; + this.button4.UseVisualStyleBackColor = false; + this.button4.Click += new System.EventHandler(this.button4_Click); + // + // button5 + // + this.button5.BackColor = System.Drawing.Color.LightPink; + this.button5.FlatStyle = System.Windows.Forms.FlatStyle.Popup; + this.button5.Location = new System.Drawing.Point(191, 268); + this.button5.Name = "button5"; + this.button5.Size = new System.Drawing.Size(94, 64); + this.button5.TabIndex = 4; + this.button5.Text = "5"; + this.button5.UseVisualStyleBackColor = false; + this.button5.Click += new System.EventHandler(this.button5_Click); + // + // button6 + // + this.button6.BackColor = System.Drawing.Color.LightPink; + this.button6.FlatStyle = System.Windows.Forms.FlatStyle.Popup; + this.button6.Location = new System.Drawing.Point(315, 268); + this.button6.Name = "button6"; + this.button6.Size = new System.Drawing.Size(94, 64); + this.button6.TabIndex = 5; + this.button6.Text = "6"; + this.button6.UseVisualStyleBackColor = false; + this.button6.Click += new System.EventHandler(this.button6_Click); + // + // button7 + // + this.button7.BackColor = System.Drawing.Color.LightPink; + this.button7.FlatStyle = System.Windows.Forms.FlatStyle.Popup; + this.button7.Location = new System.Drawing.Point(71, 350); + this.button7.Name = "button7"; + this.button7.Size = new System.Drawing.Size(94, 64); + this.button7.TabIndex = 6; + this.button7.Text = "7"; + this.button7.UseVisualStyleBackColor = false; + this.button7.Click += new System.EventHandler(this.button7_Click); + // + // button8 + // + this.button8.BackColor = System.Drawing.Color.LightPink; + this.button8.FlatStyle = System.Windows.Forms.FlatStyle.Popup; + this.button8.Location = new System.Drawing.Point(191, 350); + this.button8.Name = "button8"; + this.button8.Size = new System.Drawing.Size(94, 64); + this.button8.TabIndex = 7; + this.button8.Text = "8"; + this.button8.UseVisualStyleBackColor = false; + this.button8.Click += new System.EventHandler(this.button8_Click); + // + // button9 + // + this.button9.BackColor = System.Drawing.Color.LightPink; + this.button9.FlatStyle = System.Windows.Forms.FlatStyle.Popup; + this.button9.Location = new System.Drawing.Point(315, 350); + this.button9.Name = "button9"; + this.button9.Size = new System.Drawing.Size(94, 64); + this.button9.TabIndex = 8; + this.button9.Text = "9"; + this.button9.UseVisualStyleBackColor = false; + this.button9.Click += new System.EventHandler(this.button9_Click); + // + // button10 + // + this.button10.BackColor = System.Drawing.Color.LightPink; + this.button10.FlatStyle = System.Windows.Forms.FlatStyle.Popup; + this.button10.Location = new System.Drawing.Point(191, 439); + this.button10.Name = "button10"; + this.button10.Size = new System.Drawing.Size(94, 64); + this.button10.TabIndex = 9; + this.button10.Text = "0"; + this.button10.UseVisualStyleBackColor = false; + this.button10.Click += new System.EventHandler(this.button10_Click); + // + // button11 + // + this.button11.BackColor = System.Drawing.Color.LightPink; + this.button11.FlatStyle = System.Windows.Forms.FlatStyle.Popup; + this.button11.Font = new System.Drawing.Font("Microsoft Sans Serif", 24F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(204))); + this.button11.Location = new System.Drawing.Point(557, 190); + this.button11.Name = "button11"; + this.button11.Size = new System.Drawing.Size(94, 89); + this.button11.TabIndex = 10; + this.button11.Text = "+"; + this.button11.UseVisualStyleBackColor = false; + this.button11.Click += new System.EventHandler(this.button11_Click); + // + // button12 + // + this.button12.BackColor = System.Drawing.Color.LightPink; + this.button12.FlatStyle = System.Windows.Forms.FlatStyle.Popup; + this.button12.Font = new System.Drawing.Font("Microsoft Sans Serif", 24F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(204))); + this.button12.Location = new System.Drawing.Point(679, 190); + this.button12.Name = "button12"; + this.button12.Size = new System.Drawing.Size(94, 89); + this.button12.TabIndex = 11; + this.button12.Text = "-"; + this.button12.UseVisualStyleBackColor = false; + this.button12.Click += new System.EventHandler(this.button12_Click); + // + // button13 + // + this.button13.BackColor = System.Drawing.Color.LightPink; + this.button13.FlatStyle = System.Windows.Forms.FlatStyle.Popup; + this.button13.Font = new System.Drawing.Font("Microsoft Sans Serif", 24F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(204))); + this.button13.Location = new System.Drawing.Point(557, 311); + this.button13.Name = "button13"; + this.button13.Size = new System.Drawing.Size(94, 89); + this.button13.TabIndex = 12; + this.button13.Text = "*"; + this.button13.UseVisualStyleBackColor = false; + this.button13.Click += new System.EventHandler(this.button13_Click); + // + // button14 + // + this.button14.BackColor = System.Drawing.Color.LightPink; + this.button14.FlatStyle = System.Windows.Forms.FlatStyle.Popup; + this.button14.Font = new System.Drawing.Font("Microsoft Sans Serif", 24F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(204))); + this.button14.Location = new System.Drawing.Point(679, 311); + this.button14.Name = "button14"; + this.button14.Size = new System.Drawing.Size(94, 89); + this.button14.TabIndex = 13; + this.button14.Text = "/"; + this.button14.UseVisualStyleBackColor = false; + this.button14.Click += new System.EventHandler(this.button14_Click); + // + // textBox1 + // + this.textBox1.Font = new System.Drawing.Font("Microsoft Sans Serif", 48F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(204))); + this.textBox1.Location = new System.Drawing.Point(71, 79); + this.textBox1.Name = "textBox1"; + this.textBox1.Size = new System.Drawing.Size(338, 80); + this.textBox1.TabIndex = 15; + this.textBox1.TextChanged += new System.EventHandler(this.textBox1_TextChanged_1); + // + // textBox2 + // + this.textBox2.Font = new System.Drawing.Font("Microsoft Sans Serif", 48F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(204))); + this.textBox2.Location = new System.Drawing.Point(557, 78); + this.textBox2.Name = "textBox2"; + this.textBox2.Size = new System.Drawing.Size(464, 80); + this.textBox2.TabIndex = 16; + this.textBox2.TextChanged += new System.EventHandler(this.textBox2_TextChanged); + // + // label2 + // + this.label2.AutoSize = true; + this.label2.Font = new System.Drawing.Font("Microsoft Sans Serif", 27.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(204))); + this.label2.Location = new System.Drawing.Point(64, 25); + this.label2.Name = "label2"; + this.label2.Size = new System.Drawing.Size(221, 42); + this.label2.TabIndex = 17; + this.label2.Text = "Выражения"; + this.label2.Click += new System.EventHandler(this.label2_Click); + // + // label3 + // + this.label3.AutoSize = true; + this.label3.Font = new System.Drawing.Font("Microsoft Sans Serif", 27.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(204))); + this.label3.Location = new System.Drawing.Point(550, 25); + this.label3.Name = "label3"; + this.label3.Size = new System.Drawing.Size(197, 42); + this.label3.TabIndex = 18; + this.label3.Text = "Результат"; + this.label3.Click += new System.EventHandler(this.label3_Click); + // + // button15 + // + this.button15.BackColor = System.Drawing.Color.LightPink; + this.button15.FlatStyle = System.Windows.Forms.FlatStyle.Popup; + this.button15.Font = new System.Drawing.Font("Microsoft Sans Serif", 24F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(204))); + this.button15.Location = new System.Drawing.Point(804, 311); + this.button15.Name = "button15"; + this.button15.Size = new System.Drawing.Size(94, 89); + this.button15.TabIndex = 19; + this.button15.Text = ")"; + this.button15.UseVisualStyleBackColor = false; + this.button15.Click += new System.EventHandler(this.button15_Click); + // + // button16 + // + this.button16.BackColor = System.Drawing.Color.LightPink; + this.button16.FlatStyle = System.Windows.Forms.FlatStyle.Popup; + this.button16.Font = new System.Drawing.Font("Microsoft Sans Serif", 24F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(204))); + this.button16.Location = new System.Drawing.Point(804, 190); + this.button16.Name = "button16"; + this.button16.Size = new System.Drawing.Size(94, 89); + this.button16.TabIndex = 20; + this.button16.Text = "("; + this.button16.UseVisualStyleBackColor = false; + this.button16.Click += new System.EventHandler(this.button16_Click); + // + // button17 + // + this.button17.BackColor = System.Drawing.Color.LightPink; + this.button17.FlatStyle = System.Windows.Forms.FlatStyle.Popup; + this.button17.Font = new System.Drawing.Font("Microsoft Sans Serif", 24F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(204))); + this.button17.Location = new System.Drawing.Point(927, 421); + this.button17.Name = "button17"; + this.button17.Size = new System.Drawing.Size(94, 89); + this.button17.TabIndex = 21; + this.button17.Text = "="; + this.button17.UseVisualStyleBackColor = false; + this.button17.Click += new System.EventHandler(this.button17_Click); + // + // button19 + // + this.button19.BackColor = System.Drawing.Color.LightPink; + this.button19.FlatStyle = System.Windows.Forms.FlatStyle.Popup; + this.button19.Font = new System.Drawing.Font("Microsoft Sans Serif", 24F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(204))); + this.button19.Location = new System.Drawing.Point(557, 537); + this.button19.Name = "button19"; + this.button19.Size = new System.Drawing.Size(216, 89); + this.button19.TabIndex = 23; + this.button19.Text = "C"; + this.button19.UseVisualStyleBackColor = false; + this.button19.Click += new System.EventHandler(this.button19_Click); + // + // button20 + // + this.button20.BackColor = System.Drawing.Color.LightPink; + this.button20.FlatStyle = System.Windows.Forms.FlatStyle.Popup; + this.button20.Font = new System.Drawing.Font("Microsoft Sans Serif", 24F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(204))); + this.button20.Location = new System.Drawing.Point(43, 537); + this.button20.Name = "button20"; + this.button20.Size = new System.Drawing.Size(403, 89); + this.button20.TabIndex = 24; + this.button20.Text = "🌑"; + this.button20.UseVisualStyleBackColor = false; + this.button20.Click += new System.EventHandler(this.button20_Click_1); + // + // button21 + // + this.button21.BackColor = System.Drawing.Color.LightPink; + this.button21.FlatStyle = System.Windows.Forms.FlatStyle.Popup; + this.button21.Font = new System.Drawing.Font("Microsoft Sans Serif", 48F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(204))); + this.button21.Location = new System.Drawing.Point(557, 421); + this.button21.Name = "button21"; + this.button21.Size = new System.Drawing.Size(94, 89); + this.button21.TabIndex = 25; + this.button21.Text = " ²"; + this.button21.UseVisualStyleBackColor = false; + this.button21.Click += new System.EventHandler(this.button21_Click); + // + // button22 + // + this.button22.BackColor = System.Drawing.Color.LightPink; + this.button22.FlatStyle = System.Windows.Forms.FlatStyle.Popup; + this.button22.Font = new System.Drawing.Font("Microsoft Sans Serif", 24F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(204))); + this.button22.Location = new System.Drawing.Point(927, 311); + this.button22.Name = "button22"; + this.button22.Size = new System.Drawing.Size(94, 89); + this.button22.TabIndex = 26; + this.button22.Text = "Pi"; + this.button22.UseVisualStyleBackColor = false; + this.button22.Click += new System.EventHandler(this.button22_Click); + // + // button23 + // + this.button23.BackColor = System.Drawing.Color.LightPink; + this.button23.FlatStyle = System.Windows.Forms.FlatStyle.Popup; + this.button23.Font = new System.Drawing.Font("Microsoft Sans Serif", 24F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(204))); + this.button23.Location = new System.Drawing.Point(804, 421); + this.button23.Name = "button23"; + this.button23.Size = new System.Drawing.Size(94, 89); + this.button23.TabIndex = 27; + this.button23.Text = "!"; + this.button23.UseVisualStyleBackColor = false; + this.button23.Click += new System.EventHandler(this.button23_Click); + // + // button24 + // + this.button24.BackColor = System.Drawing.Color.LightPink; + this.button24.FlatStyle = System.Windows.Forms.FlatStyle.Popup; + this.button24.Font = new System.Drawing.Font("Microsoft Sans Serif", 24F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(204))); + this.button24.Location = new System.Drawing.Point(927, 190); + this.button24.Name = "button24"; + this.button24.Size = new System.Drawing.Size(94, 89); + this.button24.TabIndex = 28; + this.button24.Text = "%"; + this.button24.UseVisualStyleBackColor = false; + this.button24.Click += new System.EventHandler(this.button24_Click); + // + // button25 + // + this.button25.BackColor = System.Drawing.Color.LightPink; + this.button25.FlatStyle = System.Windows.Forms.FlatStyle.Popup; + this.button25.Font = new System.Drawing.Font("Microsoft Sans Serif", 48F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(204))); + this.button25.Location = new System.Drawing.Point(679, 421); + this.button25.Name = "button25"; + this.button25.Size = new System.Drawing.Size(94, 89); + this.button25.TabIndex = 29; + this.button25.Text = "³"; + this.button25.UseVisualStyleBackColor = false; + this.button25.Click += new System.EventHandler(this.button25_Click); + // + // button26 + // + this.button26.BackColor = System.Drawing.Color.LightPink; + this.button26.FlatStyle = System.Windows.Forms.FlatStyle.Popup; + this.button26.Font = new System.Drawing.Font("Microsoft Sans Serif", 24F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(204))); + this.button26.Location = new System.Drawing.Point(804, 537); + this.button26.Name = "button26"; + this.button26.Size = new System.Drawing.Size(217, 89); + this.button26.TabIndex = 30; + this.button26.Text = "Стереть символ"; + this.button26.UseVisualStyleBackColor = false; + this.button26.Click += new System.EventHandler(this.button26_Click); + // + // Form1 + // + this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(192)))), ((int)(((byte)(255)))), ((int)(((byte)(255))))); + this.ClientSize = new System.Drawing.Size(1125, 665); + this.Controls.Add(this.button26); + this.Controls.Add(this.button25); + this.Controls.Add(this.button24); + this.Controls.Add(this.button23); + this.Controls.Add(this.button22); + this.Controls.Add(this.button21); + this.Controls.Add(this.button20); + this.Controls.Add(this.button19); + this.Controls.Add(this.button17); + this.Controls.Add(this.button16); + this.Controls.Add(this.button15); + this.Controls.Add(this.label3); + this.Controls.Add(this.label2); + this.Controls.Add(this.textBox2); + this.Controls.Add(this.textBox1); + this.Controls.Add(this.button14); + this.Controls.Add(this.button13); + this.Controls.Add(this.button12); + this.Controls.Add(this.button11); + this.Controls.Add(this.button10); + this.Controls.Add(this.button9); + this.Controls.Add(this.button8); + this.Controls.Add(this.button7); + this.Controls.Add(this.button6); + this.Controls.Add(this.button5); + this.Controls.Add(this.button4); + this.Controls.Add(this.button3); + this.Controls.Add(this.button2); + this.Controls.Add(this.button1); + this.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F); + this.Name = "Form1"; + this.Text = "Form1"; + this.Load += new System.EventHandler(this.Form1_Load); + this.ResumeLayout(false); + this.PerformLayout(); + + } + + #endregion + + private System.Windows.Forms.Button button1; + private System.Windows.Forms.Button button2; + private System.Windows.Forms.Button button3; + private System.Windows.Forms.Button button4; + private System.Windows.Forms.Button button5; + private System.Windows.Forms.Button button6; + private System.Windows.Forms.Button button7; + private System.Windows.Forms.Button button8; + private System.Windows.Forms.Button button9; + private System.Windows.Forms.Button button10; + private System.Windows.Forms.Button button11; + private System.Windows.Forms.Button button12; + private System.Windows.Forms.Button button13; + private System.Windows.Forms.Button button14; + private System.Windows.Forms.TextBox textBox1; + private System.Windows.Forms.TextBox textBox2; + private System.Windows.Forms.Label label2; + private System.Windows.Forms.Label label3; + private System.Windows.Forms.Button button15; + private System.Windows.Forms.Button button16; + private System.Windows.Forms.Button button17; + private System.Windows.Forms.Button button19; + private System.Windows.Forms.Button button20; + private System.Windows.Forms.Button button21; + private System.Windows.Forms.Button button22; + private System.Windows.Forms.Button button23; + private System.Windows.Forms.Button button24; + private System.Windows.Forms.Button button25; + private System.Windows.Forms.Button button26; + } +} + diff --git a/Form1.cs b/Form1.cs new file mode 100644 index 0000000..86976b6 --- /dev/null +++ b/Form1.cs @@ -0,0 +1,340 @@ +using BaseCalculator; +using System; +using System.Collections.Generic; +using System.ComponentModel; +using System.Data; +using System.Drawing; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Windows.Forms; + +namespace Calculator +{ + public partial class Form1 : Form + { + public Form1() + { + InitializeComponent(); + } + + private void button1_Click(object sender, EventArgs e) + { + textBox1.Text += "1"; + } + + private void button3_Click(object sender, EventArgs e) + { + textBox1.Text += "3"; + } + + private void button5_Click(object sender, EventArgs e) + { + textBox1.Text += "5"; + } + + private void button9_Click(object sender, EventArgs e) + { + textBox1.Text += "9"; + } + + private void button10_Click(object sender, EventArgs e) + { + textBox1.Text += "0"; + } + + private void button8_Click(object sender, EventArgs e) + { + textBox1.Text += "8"; + } + + private void button7_Click(object sender, EventArgs e) + { + textBox1.Text += "7"; + } + + private void button6_Click(object sender, EventArgs e) + { + textBox1.Text += "6"; + } + + private void button4_Click(object sender, EventArgs e) + { + textBox1.Text += "4"; + } + + private void button2_Click(object sender, EventArgs e) + { + textBox1.Text += "2"; + } + + private void button11_Click(object sender, EventArgs e) + { + textBox1.Text += "+"; + + } + + private void textBox1_TextChanged(object sender, EventArgs e) + { + + } + + private void label2_Click(object sender, EventArgs e) + { + + } + + private void button12_Click(object sender, EventArgs e) + { + textBox1.Text += "-"; + } + + private void button16_Click(object sender, EventArgs e) + { + textBox1.Text += "("; + } + + private void button15_Click(object sender, EventArgs e) + { + textBox1.Text += ")"; + } + + private void button14_Click(object sender, EventArgs e) + { + textBox1.Text += "/"; + } + + private void button13_Click(object sender, EventArgs e) + { + textBox1.Text += "*"; + } + + + + private void button18_Click(object sender, EventArgs e) + { + textBox1.Text += "%"; + } + + private void button19_Click(object sender, EventArgs e) + { + textBox1.Text = " "; + textBox2.Text = " "; + } + + private void button20_Click(object sender, EventArgs e) + { + textBox1.Text = " "; + } + + private void button17_Click(object sender, EventArgs e) + { + try + { + string expression = textBox1.Text; + if (expression.Contains('+')) + { + string[] parts = expression.Split('+'); + if (parts.Length == 2) + { + + long a = long.Parse(parts[0]); + long b = long.Parse(parts[1]); + int result = CalcClass.Add(a, b); + textBox2.Text = result.ToString(); + } + } + + + else if (expression.Contains('-')) + { + string[] parts = expression.Split('-'); + if (parts.Length == 2) + { + + long a = long.Parse(parts[0]); + long b = long.Parse(parts[1]); + int result = CalcClass.Sub(a, b); + textBox2.Text = result.ToString(); + } + } + + else if (expression.Contains('*')) + { + string[] parts = expression.Split('*'); + if (parts.Length == 2) + { + + long a = long.Parse(parts[0]); + long b = long.Parse(parts[1]); + int result = CalcClass.Mult(a, b); + textBox2.Text = result.ToString(); + } + } + + else if (expression.Contains('/')) + { + string[] parts = expression.Split('/'); + if (parts.Length == 2) + { + + long a = long.Parse(parts[0]); + long b = long.Parse(parts[1]); + int result = CalcClass.Div(a, b); + textBox2.Text = result.ToString(); + + } + } + else if (expression.Contains('²')) + { + string[] parts = expression.Split('²'); + if (parts.Length == 2) + { + + long a = long.Parse(parts[0]); + + double result = CalcClass.Square(a); + textBox2.Text = result.ToString(); + + } + } + + else if (expression.Contains('!')) + { + string[] parts = expression.Split('!'); + if (parts.Length == 2) + { + + long a = long.Parse(parts[0]); + + long result = CalcClass.Factor((int)a); + textBox2.Text = result.ToString(); + + } + } + + else if (expression.Contains('%')) + { + string[] parts = expression.Split('%'); + if (parts.Length == 2) + { + + long a = long.Parse(parts[0]); + long b = long.Parse(parts[1]); + int result = CalcClass.Mod(a, b); + textBox2.Text = result.ToString(); + + } + } + + else if (expression.Contains('³')) + { + string[] parts = expression.Split('³'); + if (parts.Length == 2) + { + + long a = long.Parse(parts[0]); + + double result = CalcClass.Cube(a); + textBox2.Text = result.ToString(); + + } + } + + else + { + textBox2.Text = "Ошибка, неверный формат выражения"; + } + } + + catch (Exception ex) + { + textBox2.Text = $"ошибка: {ex.Message}"; + } + } + + private void button20_Click_1(object sender, EventArgs e) + { + + if (this.BackColor == Color.FromArgb(192, 255, 255)) + { + + this.BackColor = Color.FromArgb(64, 64, 64); + button20.Text = "🌑"; + label2.ForeColor = Color.White; + label3.ForeColor = Color.White; + + } + + else + { + this.BackColor = Color.FromArgb(192, 255, 255); + button20.Text = "☀"; + label2.ForeColor = Color.Black; + label3.ForeColor = Color.Black; + } + } + + private void Form1_Load(object sender, EventArgs e) + { + + } + + private void label3_Click(object sender, EventArgs e) + { + + } + + private void button21_Click(object sender, EventArgs e) + { + { + textBox1.Text += "²"; + } + } + + private void button22_Click(object sender, EventArgs e) + { + { + textBox1.Text += CalcClass.Pi; + } + } + + private void button23_Click(object sender, EventArgs e) + { + { + textBox1.Text += "!"; + } + } + + private void button24_Click(object sender, EventArgs e) + { + { + textBox1.Text += "%"; + } + } + + private void button25_Click(object sender, EventArgs e) + { + { + textBox1.Text += "³"; + } + } + + private void button26_Click(object sender, EventArgs e) + { + if (textBox1.Text.Length > 0) + textBox1.Text = textBox1.Text.Remove(textBox1.Text.Length - 1); + textBox2.Text = string.Empty; + } + + private void textBox2_TextChanged(object sender, EventArgs e) + { + + } + + private void textBox1_TextChanged_1(object sender, EventArgs e) + { + + } + } +} diff --git a/Form1.resx b/Form1.resx new file mode 100644 index 0000000..1af7de1 --- /dev/null +++ b/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/Program.cs b/Program.cs new file mode 100644 index 0000000..d232dfc --- /dev/null +++ b/Program.cs @@ -0,0 +1,22 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Threading.Tasks; +using System.Windows.Forms; + +namespace Calculator +{ + internal static class Program + { + /// + /// Главная точка входа для приложения. + /// + [STAThread] + static void Main() + { + Application.EnableVisualStyles(); + Application.SetCompatibleTextRenderingDefault(false); + Application.Run(new Form1()); + } + } +} diff --git a/Properties/AssemblyInfo.cs b/Properties/AssemblyInfo.cs new file mode 100644 index 0000000..a3a0aac --- /dev/null +++ b/Properties/AssemblyInfo.cs @@ -0,0 +1,36 @@ +using System.Reflection; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; + +// Общие сведения об этой сборке предоставляются следующим набором +// набора атрибутов. Измените значения этих атрибутов для изменения сведений, +// связанных со сборкой. +[assembly: AssemblyTitle("Calculator")] +[assembly: AssemblyDescription("")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("")] +[assembly: AssemblyProduct("Calculator")] +[assembly: AssemblyCopyright("Copyright © 2025")] +[assembly: AssemblyTrademark("")] +[assembly: AssemblyCulture("")] + +// Установка значения False для параметра ComVisible делает типы в этой сборке невидимыми +// для компонентов COM. Если необходимо обратиться к типу в этой сборке через +// COM, следует установить атрибут ComVisible в TRUE для этого типа. +[assembly: ComVisible(false)] + +// Следующий GUID служит для идентификации библиотеки типов, если этот проект будет видимым для COM +[assembly: Guid("e4720e95-9a7c-467c-a8cb-79023ba507e8")] + +// Сведения о версии сборки состоят из указанных ниже четырех значений: +// +// Основной номер версии +// Дополнительный номер версии +// Номер сборки +// Редакция +// +// Можно задать все значения или принять номера сборки и редакции по умолчанию +// используя "*", как показано ниже: +// [assembly: AssemblyVersion("1.0.*")] +[assembly: AssemblyVersion("1.0.0.0")] +[assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/Properties/Resources.Designer.cs b/Properties/Resources.Designer.cs new file mode 100644 index 0000000..c938cc0 --- /dev/null +++ b/Properties/Resources.Designer.cs @@ -0,0 +1,71 @@ +//------------------------------------------------------------------------------ +// +// Этот код создан программным средством. +// Версия среды выполнения: 4.0.30319.42000 +// +// Изменения в этом файле могут привести к неправильному поведению и будут утрачены, если +// код создан повторно. +// +//------------------------------------------------------------------------------ + +namespace Calculator.Properties +{ + + + /// + /// Класс ресурсов со строгим типом для поиска локализованных строк и пр. + /// + // Этот класс был автоматически создан при помощи StronglyTypedResourceBuilder + // класс с помощью таких средств, как ResGen или Visual Studio. + // Для добавления или удаления члена измените файл .ResX, а затем перезапустите ResGen + // с параметром /str или заново постройте свой VS-проект. + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")] + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + internal class Resources + { + + private static global::System.Resources.ResourceManager resourceMan; + + private static global::System.Globalization.CultureInfo resourceCulture; + + [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")] + internal Resources() + { + } + + /// + /// Возврат кэшированного экземпляра ResourceManager, используемого этим классом. + /// + [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] + internal static global::System.Resources.ResourceManager ResourceManager + { + get + { + if ((resourceMan == null)) + { + global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("Calculator.Properties.Resources", typeof(Resources).Assembly); + resourceMan = temp; + } + return resourceMan; + } + } + + /// + /// Переопределяет свойство CurrentUICulture текущего потока для всех + /// подстановки ресурсов с помощью этого класса ресурсов со строгим типом. + /// + [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] + internal static global::System.Globalization.CultureInfo Culture + { + get + { + return resourceCulture; + } + set + { + resourceCulture = value; + } + } + } +} diff --git a/Properties/Resources.resx b/Properties/Resources.resx new file mode 100644 index 0000000..af7dbeb --- /dev/null +++ b/Properties/Resources.resx @@ -0,0 +1,117 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + \ No newline at end of file diff --git a/Properties/Settings.Designer.cs b/Properties/Settings.Designer.cs new file mode 100644 index 0000000..7ffec34 --- /dev/null +++ b/Properties/Settings.Designer.cs @@ -0,0 +1,30 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// Runtime Version:4.0.30319.42000 +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +//------------------------------------------------------------------------------ + +namespace Calculator.Properties +{ + + + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "11.0.0.0")] + internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase + { + + private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings()))); + + public static Settings Default + { + get + { + return defaultInstance; + } + } + } +} diff --git a/Properties/Settings.settings b/Properties/Settings.settings new file mode 100644 index 0000000..3964565 --- /dev/null +++ b/Properties/Settings.settings @@ -0,0 +1,7 @@ + + + + + + + diff --git a/bin/Debug/AnalaizerClass (2).dll b/bin/Debug/AnalaizerClass (2).dll new file mode 100644 index 0000000..9644b50 Binary files /dev/null and b/bin/Debug/AnalaizerClass (2).dll differ diff --git a/bin/Debug/CalcClass.dll b/bin/Debug/CalcClass.dll new file mode 100644 index 0000000..272e88f Binary files /dev/null and b/bin/Debug/CalcClass.dll differ diff --git a/bin/Debug/Calculator.exe b/bin/Debug/Calculator.exe new file mode 100644 index 0000000..b7ee637 Binary files /dev/null and b/bin/Debug/Calculator.exe differ diff --git a/bin/Debug/Calculator.exe.config b/bin/Debug/Calculator.exe.config new file mode 100644 index 0000000..56efbc7 --- /dev/null +++ b/bin/Debug/Calculator.exe.config @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/bin/Debug/Calculator.pdb b/bin/Debug/Calculator.pdb new file mode 100644 index 0000000..032708d Binary files /dev/null and b/bin/Debug/Calculator.pdb differ diff --git a/obj/Debug/.NETFramework,Version=v4.7.2.AssemblyAttributes.cs b/obj/Debug/.NETFramework,Version=v4.7.2.AssemblyAttributes.cs new file mode 100644 index 0000000..3871b18 --- /dev/null +++ b/obj/Debug/.NETFramework,Version=v4.7.2.AssemblyAttributes.cs @@ -0,0 +1,4 @@ +// +using System; +using System.Reflection; +[assembly: global::System.Runtime.Versioning.TargetFrameworkAttribute(".NETFramework,Version=v4.7.2", FrameworkDisplayName = ".NET Framework 4.7.2")] diff --git a/obj/Debug/Calculator.Form1.resources b/obj/Debug/Calculator.Form1.resources new file mode 100644 index 0000000..6c05a97 Binary files /dev/null and b/obj/Debug/Calculator.Form1.resources differ diff --git a/obj/Debug/Calculator.Properties.Resources.resources b/obj/Debug/Calculator.Properties.Resources.resources new file mode 100644 index 0000000..6c05a97 Binary files /dev/null and b/obj/Debug/Calculator.Properties.Resources.resources differ diff --git a/obj/Debug/Calculator.csproj.AssemblyReference.cache b/obj/Debug/Calculator.csproj.AssemblyReference.cache new file mode 100644 index 0000000..d543dca Binary files /dev/null and b/obj/Debug/Calculator.csproj.AssemblyReference.cache differ diff --git a/obj/Debug/Calculator.csproj.CopyComplete b/obj/Debug/Calculator.csproj.CopyComplete new file mode 100644 index 0000000..e69de29 diff --git a/obj/Debug/Calculator.csproj.CoreCompileInputs.cache b/obj/Debug/Calculator.csproj.CoreCompileInputs.cache new file mode 100644 index 0000000..1e2fcca --- /dev/null +++ b/obj/Debug/Calculator.csproj.CoreCompileInputs.cache @@ -0,0 +1 @@ +2999f72eb8637e4aef7a88502b60f18e49c9b221d34ab695d3c15cd5283972e3 diff --git a/obj/Debug/Calculator.csproj.FileListAbsolute.txt b/obj/Debug/Calculator.csproj.FileListAbsolute.txt new file mode 100644 index 0000000..694297a --- /dev/null +++ b/obj/Debug/Calculator.csproj.FileListAbsolute.txt @@ -0,0 +1,13 @@ +D:\Calculator\bin\Debug\Calculator.exe.config +D:\Calculator\bin\Debug\Calculator.exe +D:\Calculator\bin\Debug\Calculator.pdb +D:\Calculator\bin\Debug\AnalaizerClass (2).dll +D:\Calculator\bin\Debug\CalcClass.dll +D:\Calculator\obj\Debug\Calculator.csproj.AssemblyReference.cache +D:\Calculator\obj\Debug\Calculator.Form1.resources +D:\Calculator\obj\Debug\Calculator.Properties.Resources.resources +D:\Calculator\obj\Debug\Calculator.csproj.GenerateResource.cache +D:\Calculator\obj\Debug\Calculator.csproj.CoreCompileInputs.cache +D:\Calculator\obj\Debug\Calculator.csproj.CopyComplete +D:\Calculator\obj\Debug\Calculator.exe +D:\Calculator\obj\Debug\Calculator.pdb diff --git a/obj/Debug/Calculator.csproj.GenerateResource.cache b/obj/Debug/Calculator.csproj.GenerateResource.cache new file mode 100644 index 0000000..615e2a5 Binary files /dev/null and b/obj/Debug/Calculator.csproj.GenerateResource.cache differ diff --git a/obj/Debug/Calculator.exe b/obj/Debug/Calculator.exe new file mode 100644 index 0000000..b7ee637 Binary files /dev/null and b/obj/Debug/Calculator.exe differ diff --git a/obj/Debug/Calculator.pdb b/obj/Debug/Calculator.pdb new file mode 100644 index 0000000..032708d Binary files /dev/null and b/obj/Debug/Calculator.pdb differ diff --git a/obj/Debug/DesignTimeResolveAssemblyReferences.cache b/obj/Debug/DesignTimeResolveAssemblyReferences.cache new file mode 100644 index 0000000..8b9b776 Binary files /dev/null and b/obj/Debug/DesignTimeResolveAssemblyReferences.cache differ diff --git a/obj/Debug/DesignTimeResolveAssemblyReferencesInput.cache b/obj/Debug/DesignTimeResolveAssemblyReferencesInput.cache new file mode 100644 index 0000000..0857b53 Binary files /dev/null and b/obj/Debug/DesignTimeResolveAssemblyReferencesInput.cache differ