/// <summary> /// Open a tabPageXML /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void createXMLToolStripMenuItem_Click(object sender, EventArgs e) { if (tabControl1.Visible == false) { tabControl1.Visible = true; tabControl1.TabPages[0].Dispose(); tabControl1.SelectedTab = tabControl1.TabPages["tabPageXML"]; //This new tab may be closed now closeTabToolStripMenuItem.Enabled = true; toolStripCloseTab.Enabled = true; } else { //Tabs are already open, is tabPageXML already open? if (!IstabPageXMLOpen()) { //tabControl1.TabPages.Insert(tabControl1.TabPages.Count, "tabPageXML"); tabControl1.TabPages.Add(tabPageXML); tabControl1.SelectedTab = tabControl1.TabPages[tabControl1.TabPages.Count - 1]; } else { //Already open, just select it tabControl1.SelectedTab = tabControl1.TabPages["tabPageXML"]; } } //Populate the textbox tbXMLFile.Clear(); tbXMLFile.Text = LSLSnippet.Getblankxml().ToString(); //Choose first cBoxEvents item cBoxEvents.SelectedIndex = 0; }
public Form1(params object[] args) { InitializeComponent(); if (args.Length > 1) { m_FilePath = args[0].ToString(); m_RichTextBox = args[1] as RichTextBox; } else { m_FilePath = ""; m_RichTextBox = new RichTextBox(); } //Set cBoxEvents cBoxEvents.SelectedIndex = 0; //Populate the textbox tbXMLFile.Clear(); tbXMLFile.Text = LSLSnippet.Getblankxml().ToString(); // rboxLSLScript.Text = m_RichTextBox.SelectedText; }