private void openInNewWindowToolStripMenuItem_Click(object sender, EventArgs e) { GraphForm oldForm = SeemsMdiParent.CurrentGraphForm; int oldSelectedIndex = oldForm.scanNumberComboBox.SelectedIndex; GraphForm graphForm = CreateNewWindow(SeemsMdiParent, dataSource, false); graphForm.ShowData(scanNumberComboBox.ListBox.SelectedIndex); oldForm.scanNumberComboBox.SelectedIndex = oldSelectedIndex; oldForm.Activate(); oldForm.scanNumberComboBox.Button.PerformClick(); }
public static GraphForm CreateNewWindow(Form mdiParent, DataSource dataSource, bool giveFocus) { // create a new window with this data source GraphForm graphForm = new GraphForm(dataSource); graphForm.MdiParent = mdiParent; graphForm.ShowData(0); // show chromatogram graphForm.Show(); if (giveFocus) { graphForm.Activate(); } return(graphForm); }
public GraphForm OpenGraph( bool giveFocus ) { GraphForm graphForm = new GraphForm(this); graphForm.ZedGraphControl.PreviewKeyDown += new PreviewKeyDownEventHandler( graphForm_PreviewKeyDown ); graphForm.ItemGotFocus += new EventHandler( form_GotFocus ); graphForm.Show( DockPanel, DockState.Document ); if( giveFocus ) graphForm.Activate(); return graphForm; }