private void Notepad_FormClosing(object sender, FormClosingEventArgs e) { Properties.Settings.Default.TextColorSave = NotepadText.ForeColor; Properties.Settings.Default.BackColorSave = NotepadText.BackColor; Properties.Settings.Default.TextFontSave = NotepadText.Font; Properties.Settings.Default.AppSizeSave = this.Size; Properties.Settings.Default.WordWrapSave = NotepadText.WordWrap; Properties.Settings.Default.TextWordSave = WordWrap.Text; Properties.Settings.Default.Save(); if (NotepadText.Text.Length != 0) { DialogResult s = MessageBox.Show("Do You Want Save File?", "Save", MessageBoxButtons.YesNo, MessageBoxIcon.Information); if (s == DialogResult.Yes) { SaveText.Filter = "All(*.mash)|*.mash"; SaveText.ShowDialog(); } } }
private void NewFile_Click(object sender, EventArgs e) { if (NotepadText.Text.Length == 0) { NotepadText.Text = ""; } else { DialogResult s = MessageBox.Show("Do You Want Save File?", "Save", MessageBoxButtons.YesNo, MessageBoxIcon.Information); if (s == DialogResult.Yes) { SaveText.Filter = "All(*.mash)|*.mash"; SaveText.ShowDialog(); NotepadText.Text = ""; } else { NotepadText.Text = ""; } } }
private void SaveAs_Click(object sender, EventArgs e) { SaveText.Filter = "All(*.mash)|*.mash"; SaveText.ShowDialog(); }