国产探花免费观看_亚洲丰满少妇自慰呻吟_97日韩有码在线_资源在线日韩欧美_一区二区精品毛片,辰东完美世界有声小说,欢乐颂第一季,yy玄幻小说排行榜完本

首頁 > 學院 > 開發設計 > 正文

簡易計時窗口程序

2019-11-14 12:59:54
字體:
來源:轉載
供稿:網友

using System;using System.Collections.Generic;using System.ComponentModel;using System.Data;using System.Drawing;using System.Linq;using System.Text;using System.Windows.Forms;using System.Media;namespace WindowsFormsapplication2{    public partial class Form1 : Form    {        public Form1()        {            InitializeComponent();        }        int m, s;        string tm, ts;        PRivate void timer1_Tick(object sender, EventArgs e)        {            if (m >=0 )            {                if (s == 0&&m>=1)                {                    s = 60;                    m--;                }                if (s >= 1)                {                    s--;                }            }            label1.Text = m.ToString() + ":" + s.ToString();            if (label1.Text == tm+":"+ts)            {                                SoundPlayer p = new SoundPlayer();                p.SoundLocation = Application.StartupPath + "//folder.wav";                p.Load();                p.Play();                //MessageBox.Show("還剩" + tm + "分" + ts + "秒!");            }        }        bool d = true;        private void button1_Click(object sender, EventArgs e)        {            if (textBox1.Text ==""|| textBox2.Text =="")            {                MessageBox.Show("請輸入時間!");            }            else            {                if (d)                {                    m = int.Parse(textBox1.Text);                    if (textBox2.Text == "0" || textBox2.Text == "00")                    {                        s = 60;                        m--;                    }                    else                        s = int.Parse(textBox2.Text);                    tm = textBox3.Text;                    ts = textBox4.Text;                    d = false;                    timer1.Enabled = true;                    button1.Text = "重置";                }                else                {                    d = true;                    timer1.Enabled = false;                    button1.Text = "開始";                    label1.Text = textBox1.Text + ":" + textBox2.Text;                }            }        }    }}

界面圖如下:


發表評論 共有條評論
用戶名: 密碼:
驗證碼: 匿名發表
主站蜘蛛池模板: 北安市| 巫溪县| 阳山县| 敦化市| 沙坪坝区| 陈巴尔虎旗| 武威市| 泸西县| 姜堰市| 大足县| 繁昌县| 克什克腾旗| 郯城县| 涟源市| 田阳县| 奉新县| 佛山市| 芜湖县| 卓尼县| 松江区| 石屏县| 收藏| 阆中市| 砚山县| 海盐县| 石家庄市| 大悟县| 小金县| 武平县| 松滋市| 漯河市| 治县。| 福安市| 琼结县| 项城市| 渭南市| 科技| 萨迦县| 赤峰市| 绥滨县| 阿坝县|