public MainWindow() { InitializeComponent(); LoadMachineSettings(); SamlightForm smFrm = new SamlightForm(); SLMgr = new SamLightClass(smFrm.GetControl()); mySet = new SettingsMenu(this); mySet.GetSaveBtnControl().MouseDown += SettingSaveBtn_MouseDown; myPaintCtrl = new PaintControl(SLMgr); UpdateLanguage(); UpdateUIColor(); if (Para.AutoStartSamlightSW) { string exeString = Para.SamlightAppPath;//@"D:\scaps\samlight\sam_light.exe"; if (!Helper.IsProcessOpen("sam_light")) { Process.Start(exeString); //using (Process exeProcess = Process.Start(exeString)) //{ // exeProcess.WaitForExit(); //} } } SLMgr.HideSamlightWindow(); //SLMgr.Get_Output(5); //SLMgr.Get_Output(0); //SLMgr.Get_Output(1); //SLMgr.Get_Output(2); //SLMgr.Get_Output(3); //SLMgr.Get_Output(4); VersionLbl.Content = Para.SWVersion; }
public AboutDialog( ) { okButton = new Button( ); paintControl = new PaintControl( ); SuspendLayout( ); okButton.Text = "OK"; SuspendLayout( ); okButton.Location = new Point(170, 260); okButton.Click += new EventHandler(OnOkButtonClick); paintControl.Location = new Point(10, 10); paintControl.Size = new Size(380, 240); paintControl.BackColor = Color.White; Text = "About MWFResourceEditor..."; this.FormBorderStyle = FormBorderStyle.FixedDialog; ClientSize = new Size(400, 300); AcceptButton = okButton; Controls.Add(okButton); Controls.Add(paintControl); ResumeLayout(false); }
public AboutDialog( ) { okButton = new Button( ); paintControl = new PaintControl( ); SuspendLayout( ); okButton.Text = "OK"; SuspendLayout( ); okButton.Location = new Point( 170, 260 ); okButton.Click += new EventHandler( OnOkButtonClick ); paintControl.Location = new Point( 10, 10 ); paintControl.Size = new Size( 380, 240 ); paintControl.BackColor = Color.White; Text = "About MWFResourceEditor..."; this.FormBorderStyle = FormBorderStyle.FixedDialog; ClientSize = new Size( 400, 300 ); AcceptButton = okButton; Controls.Add( okButton ); Controls.Add( paintControl ); ResumeLayout( false ); }
private void Render(Graphics TempGraphics) { Rectangle page = PageBounds; //Clear with backcolor TempGraphics.Clear(BackColor); //Draw page background if (!PageBounds.Size.Equals(Size.Empty)) { if (page.Y < Margin.Top) { page.Height = page.Height + page.Y; } if (page.X < Margin.Left) { page.Width = page.Width + page.X; } Brush bg = new SolidBrush(_bgColor); TempGraphics.FillRectangle(bg, page); } //Custom Paint! if (PaintControl != null) { PaintControl.Invoke(this, CurrentView, PageLocation, TempGraphics); } if (!PageBounds.Size.Equals(Size.Empty)) { if (_drawRect) { Pen mp = new Pen(_rectColor); //Draw page margin TempGraphics.DrawRectangle(mp, page); } if (DrawShadow) { //Draw a Shadow ShadowDrawing.DrawShadow(TempGraphics, page); } } }
public RichTextBoxHelper(RichTextBox control) { this.Control = control; this.Paint = new PaintControl(control); }