private void newQueryToolStripMenuItem_Click(object sender, EventArgs e) { UCQuery uq = new UCQuery(); uq.Initialize(this.cmbDBPath.Text); uq.Dock = DockStyle.Fill; TabPage tab = new TabPage("NewQuery1"); tab.Controls.Add(uq); this.tabControl1.TabPages.Add(tab); this.tabControl1.SelectedTab = tab; executeToolStripMenuItem.Enabled = true; btnExecuteToolbar.Enabled = true; }
private void openLINQToolStrip_Click(object sender, EventArgs e) { OpenFileDialog opf = new OpenFileDialog(); opf.Filter = "(*.linq)|*.linq|All Files(*.*)|*.*"; opf.InitialDirectory = Environment.CurrentDirectory; if (opf.ShowDialog() == DialogResult.OK) { using (StreamReader sr = new StreamReader(opf.FileName)) { string s = sr.ReadToEnd(); UCQuery uq = new UCQuery(); uq.Initialize(this.cmbDBPath.Text); uq.Dock = DockStyle.Fill; TabPage tab = new TabPage(Path.GetFileName(opf.FileName)); tab.Controls.Add(uq); this.tabControl1.TabPages.Add(tab); this.tabControl1.SelectedTab = tab; uq.SetText(s, opf.FileName); executeToolStripMenuItem.Enabled = true; btnExecuteToolbar.Enabled = true; } } }