public EngineerCalculater()
        {
            Controls.Add(TextArea);
            Controls.Add(TextLine);
            Controls.Add(TBLayout);
            Name = "EngineerCalculater";
            TextArea.AddColor1();
            TextLine.AddColor1();
            TBLayout.Controls.AddRange(new Control[] {
                ButtonSquare, ButtonPower, ButtonSinus, ButtonCosinus, ButtonTan,
                ButtonRoot, Button10Power, ButtonLog, ButtonExp, ButtonMod,
                ButtonChanePos, ButtonDeleteAll, ButtonDelete, ButtonBackspace, ButtonDevide,
                ButtonPi, Button7, Button8, Button9, ButtonMultiple,
                ButtonFactorial, Button4, Button5, Button6, ButtonMinus,
                ButtonAbsolute, Button1, Button2, Button3, ButtonPlus,
                ButtonRightHook, ButtonLeftHook, Button0, ButtonPoint, ButtonEqual
            });
            foreach (var i in TBLayout.Controls)
            {
                ((ButtonCustom)(i)).AddColor1();
            }
            Button0.Click += new EventHandler(InsertText);
            Button1.Click += new EventHandler(InsertText);
            Button2.Click += new EventHandler(InsertText);
            Button3.Click += new EventHandler(InsertText);
            Button4.Click += new EventHandler(InsertText);
            Button5.Click += new EventHandler(InsertText);
            Button6.Click += new EventHandler(InsertText);
            Button7.Click += new EventHandler(InsertText);
            Button8.Click += new EventHandler(InsertText);
            Button9.Click += new EventHandler(InsertText);

            ButtonPlus.Click     += new EventHandler(InsertOperation);
            ButtonMinus.Click    += new EventHandler(InsertOperation);
            ButtonDevide.Click   += new EventHandler(InsertOperation);
            ButtonMultiple.Click += new EventHandler(InsertOperation);
            ButtonMod.Click      += new EventHandler(InsertOperation);

            ButtonPoint.Click     += new EventHandler(InsertPoint);
            ButtonBackspace.Click += new EventHandler(Backspace);
            ButtonDelete.Click    += new EventHandler(Delete);
            ButtonDeleteAll.Click += new EventHandler(DeleteAll);

            ButtonEqual.Click    += new EventHandler(GetAnswer);
            ButtonChanePos.Click += new EventHandler(ChangePosButtons);

            ButtonPower.Click += new EventHandler(InsertOperation);
        }
Ejemplo n.º 2
0
        public ConverterDigits()
        {
            TBLayout.SuspendLayout();
            Controls.Add(TBLayout);
            Controls.Add(TextArea);
            Controls.Add(TextLine);
            Name = "ConverterDigits";

            Button7.AddColor1(); Button7.Click += new EventHandler(InsertText);
            Button8.AddColor1(); Button8.Click += new EventHandler(InsertText);
            Button9.AddColor1(); Button9.Click += new EventHandler(InsertText);
            ButtonBackspace.AddColor1(); ButtonBackspace.Click += new EventHandler(Backspace);
            ButtonC.AddColor1(); ButtonC.Click           += new EventHandler(InsertText);
            ButtonD.AddColor1(); ButtonD.Click           += new EventHandler(InsertText);
            ButtonDelete.AddColor1(); ButtonDelete.Click += new EventHandler(Delete);
            ButtonEnter.AddColor1(); ButtonEnter.Click   += new EventHandler(GetAnswer);
            ButtonI.AddColor1(); ButtonI.Click           += new EventHandler(InsertText);
            ButtonL.AddColor1(); ButtonL.Click           += new EventHandler(InsertText);
            ButtonM.AddColor1(); ButtonM.Click           += new EventHandler(InsertText);
            ButtonV.AddColor1(); ButtonV.Click           += new EventHandler(InsertText);
            ButtonX.AddColor1(); ButtonX.Click           += new EventHandler(InsertText);
            Button0.AddColor1(); Button0.Click           += new EventHandler(InsertText);
            Button1.AddColor1(); Button1.Click           += new EventHandler(InsertText);
            Button2.AddColor1(); Button2.Click           += new EventHandler(InsertText);
            Button3.AddColor1(); Button3.Click           += new EventHandler(InsertText);
            Button4.AddColor1(); Button4.Click           += new EventHandler(InsertText);
            Button5.AddColor1(); Button5.Click           += new EventHandler(InsertText);
            Button6.AddColor1(); Button6.Click           += new EventHandler(InsertText);
            TextArea.AddColor1();
            TextLine.AddColor1();

            TBLayout.Controls.AddRange(new Control[] {
                Button7, Button8, Button9, ButtonD, ButtonEnter,
                Button4, Button5, Button6, ButtonC, ButtonBackspace,
                Button1, Button2, Button3, ButtonL, ButtonDelete,
                Button0, ButtonI, ButtonV, ButtonX, ButtonM
            });
            ResumeLayout(false);
            PerformLayout();
            TBLayout.ResumeLayout(false);
        }