国产探花免费观看_亚洲丰满少妇自慰呻吟_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;                }            }        }    }}

界面圖如下:


發表評論 共有條評論
用戶名: 密碼:
驗證碼: 匿名發表
主站蜘蛛池模板: 朝阳区| 阆中市| 华坪县| 天祝| 尉犁县| 江都市| 德惠市| 壶关县| 佛山市| 澄城县| 高清| 河津市| 灵璧县| 泰和县| 新蔡县| 东阳市| 班玛县| 简阳市| 罗定市| 邢台县| 个旧市| 昌图县| 丹凤县| 汾阳市| 吉水县| 太湖县| 黄陵县| 旅游| 奇台县| 北宁市| 揭阳市| 互助| 合肥市| 高唐县| 开阳县| 庆安县| 聂荣县| 博客| 白山市| 道孚县| 贺兰县|