private void BtnUndo_Click(object sender, RoutedEventArgs e) { if (TxtBxData.CanUndo) { TxtBxData.Undo(); } TxtBxData.Focus(); }
private void BtnOpen_Click(object sender, RoutedEventArgs e) { string fileName = FileDialogHelper.HandleDialogThenGetFileName(new OpenFileDialog()); if (fileName != string.Empty) { TxtBlckFilePath.Text = fileName; TxtBxData.Text = File.ReadAllText(fileName); } TxtBxData.Focus(); }
private void BtnSaveAs_Click(object sender, RoutedEventArgs e) { string fileName = FileDialogHelper.HandleDialogThenGetFileName(new SaveFileDialog()); if (fileName != string.Empty) { File.WriteAllText(fileName, TxtBxData.Text); MessageBox.Show("Saved successfully."); } TxtBxData.Focus(); }
private void BtnSave_Click(object sender, RoutedEventArgs e) { if (!string.IsNullOrWhiteSpace(TxtBlckFilePath.Text)) { File.WriteAllText(TxtBlckFilePath.Text, TxtBxData.Text); MessageBox.Show("Saved successfully."); } else { MessageBox.Show("Invalid file path."); } TxtBxData.Focus(); }
private void BtnCut_Click(object sender, RoutedEventArgs e) { TxtBxData.Cut(); TxtBxData.Focus(); }
private void BtnSelectAll_Click(object sender, RoutedEventArgs e) { TxtBxData.SelectAll(); TxtBxData.Focus(); }