MyTimeClock/Source/MyTimeClock/RyLine/FrmConfirm.cs
紫林 317bea9fd3 TimeClock V1.0.1909.0907
*.[新增]便笺新增支持插入图片
*.[改进]改进便笺切换编辑状态的逻辑,在后台不会切换为编辑状态。
2019-09-19 10:14:02 +08:00

56 lines
1.4 KiB
C#

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;
namespace RyLine
{
public partial class FrmConfirm : Form
{
public FrmConfirm()
{
InitializeComponent();
}
private void BtnOK_Click(object sender, EventArgs e)
{
timer1.Enabled = false;
if(MessageBox.Show("请确认是否要立即执行?","询问",MessageBoxButtons.YesNo,MessageBoxIcon.Question)==DialogResult.No)
{
timer1.Enabled = true;return;
}
DialogResult = DialogResult.OK;
}
private void BtnCancel_Click(object sender, EventArgs e)
{
timer1.Enabled = false;
DialogResult = DialogResult.Cancel;
}
int Countdown = 60;
private void timer1_Tick(object sender, EventArgs e)
{
Countdown--;
if(Countdown<=0)
{
timer1.Stop();
timer1.Enabled = false;
DialogResult = DialogResult.OK;
}
else
{
LblTime.Text = Countdown.ToString() + "秒后";
}
}
private void Form1_Load(object sender, EventArgs e)
{
timer1.Enabled = true;
}
}
}