Exemple #1
0
 private void btnAccept_Click(object sender, EventArgs e)
 {
     m_settings.Set("[Default]", "DEFAULTNODENAME", tbxDefaultNodeName.Text);
     m_settings.Set("[Default]", "DEFAULTFILENAME", tbxDefaultFilename.Text);
     m_settings.Set("[Default]", "OUTPUTFOLDER", tbxOutputFolder.Text);
     m_settings.SaveSettings();
     this.DialogResult = DialogResult.OK;
     this.Hide();
 }
Exemple #2
0
        private void button_Click(object sender, EventArgs e)
        {
            String  listboxname = "lbx" + tctrlSettings.TabPages[m_selectedTabIndex].Name;
            String  txtboxname  = "tbx" + tctrlSettings.TabPages[m_selectedTabIndex].Name;
            ListBox lstBox      = (ListBox)tctrlSettings.TabPages[m_selectedTabIndex].Controls.Find(listboxname, true)[0];
            TextBox txtBox      = (TextBox)tctrlSettings.TabPages[m_selectedTabIndex].Controls.Find(txtboxname, true)[0];
            String  attribute   = tctrlSettings.TabPages[m_selectedTabIndex].Name;
            String  setting     = "";
            String  value       = "";

            if (lstBox == null)
            {
                return;
            }
            setting = lstBox.Items[lstBox.SelectedIndex].ToString();
            if (txtBox == null)
            {
                return;
            }
            value = txtBox.Text;

            m_iniFile.Set(attribute, setting, value);
        }