namespace WindowsFormsApplication3 { 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.menuStrip1 = new System.Windows.Forms.MenuStrip(); this.InputMenu = new System.Windows.Forms.ToolStripMenuItem(); this.CalcMenu = new System.Windows.Forms.ToolStripMenuItem(); this.QuitMenu = new System.Windows.Forms.ToolStripMenuItem(); this.menuStrip1.SuspendLayout(); this.SuspendLayout(); // // menuStrip1 // this.menuStrip1.Items.AddRange(new System.Windows.Forms.ToolStripItem[] { this.InputMenu, this.CalcMenu, this.QuitMenu}); this.menuStrip1.Location = new System.Drawing.Point(0, 0); this.menuStrip1.Name = "menuStrip1"; this.menuStrip1.Size = new System.Drawing.Size(277, 24); this.menuStrip1.TabIndex = 3; this.menuStrip1.Text = "menuStrip1"; // // InputMenu // this.InputMenu.Name = "InputMenu"; this.InputMenu.Size = new System.Drawing.Size(47, 20); this.InputMenu.Text = "Input"; this.InputMenu.Click += new System.EventHandler(this.InputMenu_Click); // // CalcMenu // this.CalcMenu.Enabled = false; this.CalcMenu.Name = "CalcMenu"; this.CalcMenu.Size = new System.Drawing.Size(42, 20); this.CalcMenu.Text = "Calc"; this.CalcMenu.Click += new System.EventHandler(this.CalcMenu_Click); // // QuitMenu // this.QuitMenu.Name = "QuitMenu"; this.QuitMenu.Size = new System.Drawing.Size(42, 20); this.QuitMenu.Text = "Quit"; this.QuitMenu.Click += new System.EventHandler(this.QuitMenu_Click); // // Form1 // this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; this.ClientSize = new System.Drawing.Size(277, 29); this.Controls.Add(this.menuStrip1); this.Name = "Form1"; this.Text = "Лабораторная 1"; this.Load += new System.EventHandler(this.Form1_Load); this.menuStrip1.ResumeLayout(false); this.menuStrip1.PerformLayout(); this.ResumeLayout(false); this.PerformLayout(); } void QuitMenu_Click(object sender, System.EventArgs e) { Close(); } void CalcMenu_Click(object sender, System.EventArgs e) { Form3 R = new Form3(); if (Summa) { R.ResultText += "Number1 + Number2 = " + (Number1 + Number2).ToString() + "\r\n"; } if (MaxDivisor) { double Min = System.Math.Min(System.Math.Abs(Number1), System.Math.Abs(Number1)); bool check = false; for (; Min > 1; --Min) { if (System.Math.IEEERemainder(Number1, Min) == 0 && System.Math.IEEERemainder(Number2, Min) == 0) { R.ResultText += "Наибольший общий делитель = " + Min.ToString() + "\r\n"; check = true; break; } } if (!check || Number1 == 0 || Number2 == 0) { R.ResultText += "У Number1 и Number2 нет общих делителей \r\n"; } } if (Multiplay) { R.ResultText += "Number1 * Number2 = " + (Number1 * Number2).ToString() + "\r\n"; } R.ShowDialog(); } void InputMenu_Click(object sender, System.EventArgs e) { var D = new Form2(); D.ShowDialog(); if (D.DialogResult != System.Windows.Forms.DialogResult.Cancel) { Form1.Summa = D.summa; Form1.Multiplay = D.multiplay; Form1.MaxDivisor = D.maxDivisor; CalcMenu.Enabled = true; } } static internal bool Summa = false; static internal bool MaxDivisor = false; static internal bool Multiplay = false; static internal double Number1; static internal double Number2; static internal bool Check = false; #endregion private System.Windows.Forms.MenuStrip menuStrip1; private System.Windows.Forms.ToolStripMenuItem InputMenu; private System.Windows.Forms.ToolStripMenuItem CalcMenu; private System.Windows.Forms.ToolStripMenuItem QuitMenu; } }