private void button4_Click(object sender, EventArgs e) { try { Settings_report f = new Settings_report(this); f.ShowDialog(); } catch (Exception ex) { metroProgressSpinner1.Visible = true; MyMessageBox.Show(Owner, ex.Message, "Ошибка", MessageBoxButtons.OK, MessageBoxIcon.Error, 150, 400); metroProgressSpinner1.Visible = false; } }
}//Получение состояния параметра по его индексу public void set_control(Settings_report f, General gen) { //size_text_word f.cb_size_text.Text = Properties.Settings.Default.size_text_word.ToString(); f.tb_header_text.Text = Properties.Settings.Default.text_header_word; f.cb_style_text.Text = Properties.Settings.Default.text_style_word; //header_word if (gen.get_setting(11)) { f.cb_header.Checked = true; } else { f.cb_header.Checked = false; } //worker if (gen.get_setting(0)) { f.cb_worker.Checked = true; } else { f.cb_worker.Checked = false; } //client if (gen.get_setting(1)) { f.cb_client.Checked = true; } else { f.cb_client.Checked = false; } //theme if (gen.get_setting(2)) { f.cb_theme.Checked = true; } else { f.cb_theme.Checked = false; } //start data if (gen.get_setting(3)) { f.cb_start_date.Checked = true; } else { f.cb_start_date.Checked = false; } //end data if (gen.get_setting(4)) { f.cb_end_date.Checked = true; } else { f.cb_end_date.Checked = false; } //status if (gen.get_setting(5)) { f.cb_status.Checked = true; } else { f.cb_status.Checked = false; } //price if (gen.get_setting(6)) { f.cb_price.Checked = true; } else { f.cb_price.Checked = false; } //html if (gen.get_setting(7)) { f.cb_html.Checked = true; } else { f.cb_html.Checked = false; } //show id if (gen.get_setting(8)) { f.cb_show_id.Checked = true; } else { f.cb_show_id.Checked = false; } //multi if (gen.get_setting(9)) { f.cb_multi.Checked = true; f.cb_field.Visible = true; f.cb_field.Text = Properties.Settings.Default.only; } else { f.cb_multi.Checked = false; f.cb_field.Visible = false; } //search for date if (gen.get_setting(10)) { f.cb_date.Checked = true; f.cb_style_date.Text = Properties.Settings.Default.style_date; f.dt_s_date.Value = Properties.Settings.Default.s_date; f.dt_e_date.Value = Properties.Settings.Default.e_date; } else { f.cb_date.Checked = false; } }//Установление состояния контролов на форме настройки