呢位大哥大姐帮帮忙 输完时间怎么响不了
using System;using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
namespace WindowsApplication2
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
private void label1_Click(object sender, EventArgs e)
{
}
private void Form1_Load(object sender, EventArgs e)
{
}
public int flag = 0,canshu=0;
private void button1_Click(object sender, EventArgs e)
{
canshu = flag + int.Parse(textBox1.Text) * 60;
}
private void timer1_Tick(object sender, EventArgs e)
{
flag++;
timer1.Interval = 1000;
if (flag == canshu)
{
//闹钟
}
}
}
} --------------------编程问答-------------------- 你想什么响? --------------------编程问答-------------------- Beep --------------------编程问答-------------------- 就是 输入1~60后 任意数字 到点 想起提示声 --------------------编程问答-------------------- timer.start()
开始计时了吗? --------------------编程问答-------------------- timer1.Interval = 1000; //这句放里面做什么啊,直接在属性里修改一下就ok了
--------------------编程问答--------------------
using System;--------------------编程问答-------------------- 谢谢 各位 学长的帮助
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
namespace WindowsApplication2
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
private void label1_Click(object sender, EventArgs e)
{
}
private void Form1_Load(object sender, EventArgs e)
{
}
public int flag = 0,canshu=0;
private void button1_Click(object sender, EventArgs e)
{
canshu = flag + int.Parse(textBox1.Text) * 60;
}
private void timer1_Tick(object sender, EventArgs e)
{
flag++;
timer1.Interval = 1000;
if (flag == canshu)
{
Console.Beep(2000, 1000); }
}
}
}
补充:.NET技术 , C#