我正在开发防病毒程序和实时保护面板上我想要复选框,例如未选中“恶意软件保护”复选框以使其在 15 分钟内无法启用,然后再次启用它以防止垃圾邮件。如果有人可以帮助我,那就太好了
我尝试过,Thread.Sleep()但它会停止整个应用程序,我尝试过使用计时器,但我认为我做错了。
这是计时器的代码
private void checkBox1_CheckStateChanged(object sender, EventArgs e)
{
if (this.checkBox1.Checked)
{
this.checkBox1.Text = "On";
// these two pictureboxes are for "You are (not) protected"
// picture
picturebox1.Show();
pictureBox5.Hide();
timer1.Stop();
}
else
{
this.checkBox1.Text = "Off";
// this is the problem
timer1.Start();
this.checkBox1.Enabled = true;
pictureBox1.Hide();
pictureBox5.Show();
}
}
private void timer1_Tick(object sender, EventArgs e)
{
this.checkBox1.Enabled = false;
}
小唯快跑啊
蝴蝶不菲
杨魅力
相关分类