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

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

簡易計時窗口程序

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

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;                }            }        }    }}

界面圖如下:


發表評論 共有條評論
用戶名: 密碼:
驗證碼: 匿名發表
主站蜘蛛池模板: 张家川| 溧水县| 霍邱县| 陕西省| 宣汉县| 台州市| 德安县| 营口市| 汝南县| 罗甸县| 林芝县| 宁晋县| 蚌埠市| 荃湾区| 米林县| 余江县| 读书| 浏阳市| 驻马店市| 九台市| 贞丰县| 扶绥县| 新余市| 马尔康县| 神农架林区| 广南县| 买车| 荃湾区| 嘉义县| 巴中市| 洪雅县| 岐山县| 湄潭县| 鹤山市| 邛崃市| 北票市| 兴义市| 眉山市| 来宾市| 吉木萨尔县| 仙游县|