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

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

簡易計時窗口程序

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

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

界面圖如下:


發表評論 共有條評論
用戶名: 密碼:
驗證碼: 匿名發表
主站蜘蛛池模板: 三明市| 郑州市| 白银市| 长葛市| 夏津县| 卫辉市| 樟树市| 邢台市| 景洪市| 建湖县| 富平县| 任丘市| 日喀则市| 台前县| 潼南县| 五台县| 内黄县| 潮安县| 师宗县| 朝阳区| 保亭| 饶阳县| 金塔县| 宜宾市| 柳州市| 泊头市| 建水县| 霞浦县| 南岸区| 沁水县| 峡江县| 祁东县| 乐都县| 伊金霍洛旗| 惠州市| 婺源县| 吴桥县| 谷城县| 德昌县| 开化县| 碌曲县|