コード例 #1
0
ファイル: FormMain.cs プロジェクト: ReneeHuh/CountDownClock
        private void Form1_Load(object sender, EventArgs e)
        {
            isVisable();

            myCountDown.CountDownChanged += new EventHandler <TimeChangedEventArgs>(myCountDown_CountDownChanged);
            myCountDown.TimeTick         += new EventHandler <EventArgs>(myCountDown_TimeTick);

            myCountDown.AddSeconds(Properties.Settings.Default.DefaultSeconds);

            CDCControls.LoadWaves();
            CDCControls.WavSelection = Properties.Settings.Default.WavFileSelected;
            CDCControls.WavPlayTimes = Properties.Settings.Default.WavPlayTimes;
        }
コード例 #2
0
        private void Form1_Load(object sender, EventArgs e)
        {
            bool visible = false;

            foreach (var screen in Screen.AllScreens)
            {
                if (screen.WorkingArea.Contains(this.DesktopLocation))
                {
                    visible = true;
                    break;
                }
            }
            if (!visible)
            {
                this.Location = new Point(100, 100);
            }


            TimeToCountDown.AddSeconds(Properties.Settings.Default.DefaultSeconds);

            CDCControls.LoadWaves();
            CDCControls.WavSelection = Properties.Settings.Default.WavFileSelected;
            CDCControls.WavPlayTimes = Properties.Settings.Default.WavPlayTimes;

            //string[] array2 = Directory.GetFiles("wavs/", "*.wav");
            //try
            //{
            //    string location = array2[0];
            //    System.Media.SoundPlayer player = new System.Media.SoundPlayer(location);
            //    player.PlaySync();
            //}
            //catch
            //{
            //    MessageBox.Show("cant play wave");
            //}

            DisplayRefesh();
            CDTimer          = new System.Timers.Timer(1000);
            CDTimer.Elapsed += new System.Timers.ElapsedEventHandler(TimerTick);

            backgroundWorker1.RunWorkerCompleted += new RunWorkerCompletedEventHandler(backgroundWorker1_RunWorkerCompleted);
        }