File size: 1,054 Bytes
e26fba6
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;

namespace BlueTube.Viewer
{
    public partial class NotepadForm : Form
    {
        private Form parent;
        public NotepadForm()
        {
            InitializeComponent();
        }

        public NotepadForm(Form parent)

            :this()
        {
            this.parent = parent;
        }

        private void NotepadForm_KeyDown(object sender, KeyEventArgs e)
        {
            if (e.Control && e.KeyCode == Keys.S)       // Ctrl-S Save
            {
                this.Hide();
                this.parent.Show();
                e.SuppressKeyPress = true;
            }
        }

        private void NotepadForm_FormClosing(object sender, FormClosingEventArgs e)
        {
            if (e.CloseReason == CloseReason.UserClosing)
            {
                this.parent.Close();
            }
        }
    }
}