protected override void OnKeyDown(KeyEventArgs e) { if (e.KeyCode == Keys.Delete) { VirtualPaper.Clear(); } }
//Menu functions private void MenuItem_Open(object sender, RoutedEventArgs e) { Microsoft.Win32.OpenFileDialog OpenDialog = new Microsoft.Win32.OpenFileDialog(); OpenDialog.DefaultExt = ".txt"; OpenDialog.Filter = notpad.Properties.Resources.FiletypeFilter; bool?result = OpenDialog.ShowDialog(); if (result == true) { Paper.Clear(); documentFilename = OpenDialog.FileName; ReadFromFile(documentFilename); Title = notpad.Properties.Resources.MainWIndowTitle + documentFilename; } }
private void MenuItem_Close(object sender, RoutedEventArgs e) { Paper.Clear(); documentFilename = notpad.Properties.Resources.NewTextFile; Title = notpad.Properties.Resources.MainWIndowTitle + documentFilename; }