コード例 #1
0
        internal static void Show()
        {
            Form = new SongForm();

            Form.Timer.Tick       += Timer_Tick;
            Form.PlayButton.Click += PlayButton_Click;
            Form.StopButton.Click += StopButton_Click;
            Form.FormClosed       += Form_FormClosed;

            Form.Show();
        }
コード例 #2
0
        private static void Form_FormClosed(object sender, System.Windows.Forms.FormClosedEventArgs e)
        {
            Form.PlayButton.Click -= PlayButton_Click;
            Form.StopButton.Click -= StopButton_Click;
            Form.FormClosed       -= Form_FormClosed;

            Form.Timer.Stop();
            Timer.Change(Timeout.Infinite, 10);

            SongPlayer.Stop();
            Midi.MidiPlayer.Stop();

            Form = null;
        }