private void menuItem_Modify_Click(object sender, EventArgs e) { string activeControlType = ""; object oActiveControl; if (this.ActiveControl is SplitContainer) { activeControlType = ((SplitContainer)this.ActiveControl).ActiveControl.GetType().ToString(); oActiveControl = ((SplitContainer)this.ActiveControl).ActiveControl; } else { activeControlType = this.ActiveControl.GetType().ToString(); oActiveControl = this.ActiveControl; } if (activeControlType == "System.Windows.Forms.ListBox") { ListBox listBox = (ListBox)oActiveControl; Modify modifyform = new Modify(); if (listBox.SelectedItem != null) { modifyform.load(listBox.SelectedItem.ToString()); modifyform.ShowDialog(); //MessageBox.Show(modifyform.ret_str); if (!listBox.Items.Contains(modifyform.ret_str)) listBox.Items[listBox.SelectedIndex] = modifyform.ret_str; } } }
private void menuItem_EditExclure_Click(object sender, EventArgs e) { string s_store = treeView1.SelectedNode.Name + ":::" + treeView1.SelectedNode.ToolTipText;//textBox_AttFirstPage.Text + ":::" + textBox_FirstPage.Text; Modify modifyform = new Modify(); modifyform.load(s_store); modifyform.ShowDialog(); if (tabControl1.SelectedTab == tabControl1.TabPages[1]) if (tabControl2.SelectedTab == tabControl2.TabPages[0]) { if (modifyform.ret_str.Length > 3 && !listBoxExFirstPage.Items.Contains(modifyform.ret_str) && !checkBoxTri.Checked) listBoxExFirstPage.Items.Add(modifyform.ret_str); else if (modifyform.ret_str.Length > 3 && !listBoxExFirstPage.Items.Contains(modifyform.ret_str) && !checkBoxTri.Checked) listBoxExtri.Items.Add(modifyform.ret_str); } else if (tabControl2.SelectedTab == tabControl2.TabPages[1]) { if (modifyform.ret_str.Length > 3 && !listBoxExPageSuivant.Items.Contains(modifyform.ret_str)) listBoxExPageSuivant.Items.Add(modifyform.ret_str); } else if (tabControl2.SelectedTab == tabControl2.TabPages[2]) { if (modifyform.ret_str.Length > 3 && !listBoxExAnnonce.Items.Contains(modifyform.ret_str) && (!checkBoxFullPage.Checked || checkBoxBack.Checked)) listBoxExAnnonce.Items.Add(modifyform.ret_str); if (modifyform.ret_str.Length > 3 && !listBoxExGoBack.Items.Contains(modifyform.ret_str) && (checkBoxFullPage.Checked && !checkBoxBack.Checked)) listBoxExGoBack.Items.Add(modifyform.ret_str); } }
private void menuItem_EditInclure_Click(object sender, EventArgs e) { string s_store = treeView1.SelectedNode.Name + ":::" + treeView1.SelectedNode.ToolTipText;//textBox_AttFirstPage.Text + ":::" + textBox_FirstPage.Text; /* if (this.ActiveControl is ListBox) { //Console.WriteLine(sender.GetType().ToString() + " active control : " + this.ActiveControl.ToString()); ListBox listBox = (ListBox)this.ActiveControl; Modify modifyform = new Modify(); if (listBox.SelectedItem != null) modifyform.load(listBox.SelectedItem.ToString()); modifyform.ShowDialog(); //MessageBox.Show(modifyform.ret_str); if (modifyform.ret_str.Length > 3 && !listBox.Items.Contains(modifyform.ret_str)) listBox.Items.Add(modifyform.ret_str); } */ Modify modifyform = new Modify(); modifyform.load(s_store); modifyform.ShowDialog(); if (tabControl1.SelectedTab == tabControl1.TabPages[1]) if (tabControl2.SelectedTab == tabControl2.TabPages[0]) { if (modifyform.ret_str.Length > 3 && !listBoxInFirstPage.Items.Contains(modifyform.ret_str) && !checkBoxTri.Checked) listBoxInFirstPage.Items.Add(modifyform.ret_str); else if (modifyform.ret_str.Length > 3 && !listBoxInFirstPage.Items.Contains(modifyform.ret_str) && checkBoxTri.Checked) listBoxIntri.Items.Add(modifyform.ret_str); } else if (tabControl2.SelectedTab == tabControl2.TabPages[1]) { if (modifyform.ret_str.Length > 3 && !listBoxInPageSuivant.Items.Contains(modifyform.ret_str)) listBoxInPageSuivant.Items.Add(modifyform.ret_str); } else if (tabControl2.SelectedTab == tabControl2.TabPages[2]) { if (modifyform.ret_str.Length > 3 && !listBoxInAnnonce.Items.Contains(modifyform.ret_str) && (!checkBoxFullPage.Checked || checkBoxBack.Checked)) listBoxInAnnonce.Items.Add(modifyform.ret_str); if (modifyform.ret_str.Length > 3 && !listBoxInGoBack.Items.Contains(modifyform.ret_str) && (checkBoxFullPage.Checked && !checkBoxBack.Checked)) listBoxInGoBack.Items.Add(modifyform.ret_str); } }
private void menuItem_Add_Click(object sender, EventArgs e) { //Console.WriteLine(sender.GetType().ToString()+" active control : "+this.ActiveControl.ToString()); string activeControlType = ""; object oActiveControl; if (this.ActiveControl is SplitContainer) { activeControlType = ((SplitContainer)this.ActiveControl).ActiveControl.GetType().ToString(); oActiveControl = ((SplitContainer)this.ActiveControl).ActiveControl; } else { activeControlType = this.ActiveControl.GetType().ToString(); oActiveControl = this.ActiveControl; } if (activeControlType == "System.Windows.Forms.ListBox") { ListBox listBox = (ListBox)oActiveControl; //Console.WriteLine(sender.GetType().ToString() + " active control : " + this.ActiveControl.ToString()); Modify modifyform = new Modify(); if (listBox.SelectedItem != null) modifyform.load(listBox.SelectedItem.ToString()); modifyform.ShowDialog(); //MessageBox.Show(modifyform.ret_str); if (modifyform.ret_str.Length > 3 && !listBox.Items.Contains(modifyform.ret_str)) listBox.Items.Add(modifyform.ret_str); } }