private void tabControl1_SelectedIndexChanged(object sender, EventArgs e) { if (tabControl1.SelectedIndex == 0) { ParceTimer.Start(); if (Settings.Default.Autosave) { this.AnimationTimer.Start(); } this.CopyToolButton.Visible = true; this.PasteToolButton.Visible = true; this.CutToolButton.Visible = true; this.toolStripSeparator4.Visible = true; this.toolStripSplitButton1.Enabled = false; } else { ParceTimer.Stop(); this.AnimationTimer.Stop(); this.CopyToolButton.Visible = false; this.PasteToolButton.Visible = false; this.CutToolButton.Visible = false; this.toolStripSeparator4.Visible = false; this.toolStripSplitButton1.Enabled = true; } RefreshScreen(); }
public Form1() { InitializeComponent(); scaleTrack = new ToolStripControlHost(new TrackBar()); ((TrackBar)scaleTrack.Control).LargeChange = 10; ((TrackBar)scaleTrack.Control).Maximum = 200; ((TrackBar)scaleTrack.Control).Minimum = 20; ((TrackBar)scaleTrack.Control).Name = "trackBar1"; ((TrackBar)scaleTrack.Control).Size = new System.Drawing.Size(300, 18); ((TrackBar)scaleTrack.Control).TabIndex = 5; ((TrackBar)scaleTrack.Control).Value = 100; ((TrackBar)scaleTrack.Control).Scroll += new System.EventHandler(this.trackBar1_Scroll); this.toolStripSplitButton1.DropDownItems.Add(scaleTrack); this.Size = new System.Drawing.Size(800, 600); parser = new Parser(); sParser = new SympleParser(); optWindow = new options(); TextContextMenu = new ContextMenuStrip(); TextContextMenu.Items.Add("Cut"); TextContextMenu.Items.Add("Copy"); TextContextMenu.Items.Add("Paste"); this.richTextBox1.ContextMenuStrip = TextContextMenu; TextContextMenu.ItemClicked += new ToolStripItemClickedEventHandler(TextContextMenu_Click); this.pictureBox1.SimulationStarted += this.SimulStarted; this.pictureBox1.SimulationStoped += this.SimulStoped; Saved = true; TextCH = false; Inv = false; Analysed = false; AddStateButtonSelected = false; b_Parsing = false; b_FileLoad = false; FileInfo fi = new FileInfo("simul.exe"); if (fi.Exists) { try { fi.Delete(); } catch (UnauthorizedAccessException ex) { MessageBox.Show(ex.Message); } } ParceTimer.Start(); //this.DataBindings.Add(new Binding("Size", Settings.Default, "MainWndSize", false, DataSourceUpdateMode.OnPropertyChanged)); //this.OnResizeEnd(null); this.Size = Settings.Default.MainWndSize; if (Settings.Default.MainWndMaximized) { this.WindowState = FormWindowState.Maximized; } else { this.WindowState = FormWindowState.Normal; } ApplySettings(); }