void loadpage() { Properties.Settings ps = Properties.Settings.Default; if (ps.Top4 == -100) { this.WindowStartupLocation = System.Windows.WindowStartupLocation.CenterScreen; } else { this.Top = ps.Top4; this.Left = ps.Left4; } if (ps.SizeToContent4 == 1) { this.WindowState = WindowState.Maximized; } else { this.Width = ps.Width4; this.Height = ps.Height4; } }
private void Window_Closing(object sender, System.ComponentModel.CancelEventArgs e) { Properties.Settings ps = Properties.Settings.Default; ps.Top4 = this.Top; ps.Left4 = this.Left; if (this.WindowState == WindowState.Maximized) { ps.SizeToContent4 = 1; } else { ps.SizeToContent4 = 0; ps.Width4 = this.Width; ps.Height4 = this.Height; } ps.Save(); string autoptim_otvet = ""; foreach (btn_spis elem in lbbutton.Items) { if (!elem.vibran) { autoptim_otvet += elem.id + "#" + elem.name + "^"; } } autoptim_otvet = autoptim_otvet.Trim('^'); // EDIT = "1"; string t = @"PRIM=" + tb1.Text.Replace('\'', ' ').Replace('"', '#').Replace(';', '|').Replace(',', '@').Replace('/', '№').Replace(':', ' ').Trim() + @";AVTO=" + AUTO + @";EDIT=" + (cb1.IsChecked.Value?"1":"0") + @";SAVTO=" + autoptim_otvet; //string t = @"PRIM=" + tb1.Text.Replace('\'', ' ').Replace('"', '#').Replace(';', '|').Replace(',', '@').Replace('/', '№').Replace(':', ' ').Trim() + @";AVTO=" + autoptim_otvet + @";EDIT=" + EDIT; // MessageBox.Show(t); //pfrhsnbt if (zakrit_ok) { if (chekupdate()) { this.text_otvet = t; } } else { //if (this.text_otvet != t) if (chekupdate()) { if (MessageBox.Show( "Вы изменили примечания, хотели бы Вы их сохранить?", "Предупреждение", MessageBoxButton.YesNo, MessageBoxImage.Question) == MessageBoxResult.Yes) { this.text_otvet = t; } } } }