Example #1
0
 protected override void OnKeyDown(KeyEventArgs e)
 {
     if (e.KeyCode == Keys.Delete)
     {
         VirtualPaper.Clear();
     }
 }
Example #2
0
        //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;
            }
        }
Example #3
0
 private void MenuItem_Close(object sender, RoutedEventArgs e)
 {
     Paper.Clear();
     documentFilename = notpad.Properties.Resources.NewTextFile;
     Title            = notpad.Properties.Resources.MainWIndowTitle + documentFilename;
 }