Beispiel #1
0
 /// <summary>
 /// 冻结
 /// </summary>
 public void Freeze()
 {
     try
     {
         if (ButtonEnter.InvokeRequired)
         {
             FreezeDelegate d = Freeze;
             ButtonEnter.Invoke(d);
         }
         else
         {
             //冻结所有控件
             ButtonEnter.Enabled  = false;
             ButtonCancle.Enabled = true;
             input_name.Enabled   = false;
             checkBox1.Enabled    = checkBox2.Enabled = false;
             Browse.Enabled       = false;
             InputPageNum.Enabled = InputStartPicNum.Enabled = InputMaxPicNum.Enabled = false;
             InputCookie.Enabled  = false;
         }
     }
     catch
     {
     }
 }
Beispiel #2
0
 private void Form1_KeyDown(object sender, KeyEventArgs e)
 {
     if (e.KeyValue == (char)Keys.Enter)
     {
         ButtonEnter.PerformClick();
     }
 }
        public CodingMathRequest()
        {
            ConsoleTextBox.AddColor1();
            HowSaveFile.AddColor1();
            OpenFile.AddColor1();
            ButtonCopy.AddColor1();
            ButtonPaste.AddColor1();
            ButtonDelete.AddColor1();
            ButtonEnter.AddColor1();
            SaveFile.AddColor1();
            CloseFile.AddColor1();
            ButtonDelete.Click += new EventHandler(delegate(object sender, EventArgs e){ TextArea.Clear(); });
            ButtonCopy.Click   += new EventHandler(Copy);
            ButtonPaste.Click  += new EventHandler(Paste);
            ButtonEnter.Click  += new EventHandler(StartScript);
            Console.SuspendLayout();
            TBLayout.SuspendLayout();
            Console.ResumeLayout(false);
            Console.PerformLayout();
            TBLayout.ResumeLayout(false);

            // CodingMathRequest
            Controls.Add(Console);
            Controls.Add(TBLayout);
            Controls.Add(TextArea);
            Name = "CodingMathRequest";

            OpenFile.Click           += new EventHandler(OpenFiles);
            SaveFile.Click           += new EventHandler(SaveFiles);
            CloseFile.Click          += new EventHandler(CloseFiles);
            HowSaveFile.Click        += new EventHandler(HowSaveFiles);
            TextArea.DragEnter       += new DragEventHandler(DragEnterFile);
            TextArea.DragDrop        += new DragEventHandler(DragDropFile);
            ConsoleTitle.DoubleClick += new EventHandler(OpenConsole);

            // Console
            Console.Controls.Add(ConsoleTextBox);
            Console.Controls.Add(ConsoleTitle);
            Console.Dock        = DockStyle.Bottom;
            Console.Location    = new Point(0, 479);
            Console.Margin      = new Padding(0);
            Console.MaximumSize = new Size(487, 250);
            Console.MinimumSize = new Size(487, 44);
            Console.Name        = "Console";
            Console.Size        = new Size(487, 44);
            Console.TabIndex    = 0;

            TBLayout.Controls.AddRange(new Control[] {
                OpenFile, SaveFile, HowSaveFile, CloseFile, ButtonPaste, ButtonCopy, ButtonDelete, ButtonEnter
            });
        }
        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);
        }
 /// <summary>
 /// 解冻
 /// </summary>
 public void UnFreeze()
 {
     try
     {
         if (ButtonEnter.InvokeRequired)
         {
             UnFreezeDelegate d = UnFreeze;
             ButtonEnter.Invoke(d);
         }
         else
         {
             //解冻所有控件
             ButtonEnter.Enabled        = true;
             ButtonCancle.Enabled       = false;
             input_name.Enabled         = true;
             RadioButtonGallery.Enabled = RadioButtonScraps.Enabled = true;
             Browse.Enabled             = true;
             InputPageNum.Enabled       = InputStartPicNum.Enabled = true;
         }
     }
     catch
     {
     }
 }