private void UpdateFontSize() { //if (Double.TryParse(this.numericUpDownTitleSize.Text, out double t) && Double.TryParse(this.numericUpDownLabelSize.Text, out double l)) //{ // _vg.SetFont(t, l); //} _vg.SetFont(Convert.ToDouble(numericUpDownTitleSize.Value), Convert.ToDouble(numericUpDownLabelSize.Value)); }
public Set_Font(formVoltammogram vg) { InitializeComponent(); this.Disposed += (sender, args) => { // // ここに後処理を記述 // Console.WriteLine("Set_Font.Disposed called"); //MessageBox.Show("test"); Properties.Settings.Default.Save(); //if (Double.TryParse(this.numericUpDownTitleSize.Text, out double t) && Double.TryParse(this.numericUpDownLabelSize.Text, out double l)) //{ // Properties.Settings.Default.font_title = t; // Properties.Settings.Default.font_label = l; // Properties.Settings.Default.tick_dir_major = comboBoxTickDirMajor.SelectedIndex; // Properties.Settings.Default.tick_dir_minor = comboBoxTickDirMinor.SelectedIndex; // Properties.Settings.Default.size_weight= int.Parse(textBoxWidth.Text); // Properties.Settings.Default.size_height = int.Parse(textBoxHeight.Text); // Properties.Settings.Default.Save(); //} }; _vg = vg; double t = Properties.Settings.Default.font_title; double l = Properties.Settings.Default.font_label; this.numericUpDownTitleSize.Value = Convert.ToDecimal(t); this.numericUpDownLabelSize.Value = Convert.ToDecimal(l); _vg.SetFont(t, l); int major = Properties.Settings.Default.tick_dir_major; int minor = Properties.Settings.Default.tick_dir_minor; this.comboBoxTickDirMajor.SelectedIndex = major; this.comboBoxTickDirMinor.SelectedIndex = minor; int w = Properties.Settings.Default.size_weight; int h = Properties.Settings.Default.size_height; this.textBoxWidth.Text = w.ToString(); this.textBoxHeight.Text = h.ToString(); numericUpDownLineStyle1.Value = Convert.ToDecimal(Properties.Settings.Default.line_style_1); numericUpDownLineStyle2.Value = Convert.ToDecimal(Properties.Settings.Default.line_style_2); numericUpDownLineStyle3.Value = Convert.ToDecimal(Properties.Settings.Default.line_style_3); }