一个text框中输入文字,几个Radiobutton用来选择时间.当我从一个Radiobutton中选择一个时间值时,比如选2点 时,单击button按钮,当到2点时会弹出一个对话框显示text框中的内容。请简单点好,我是出学者~~~~~~~

解决方案 »

  1.   

    用form.timer就可以了。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();
            }
            Alert alert;
                   private void timer1_Tick(object sender, EventArgs e)
            {
                if (radioButton1.Checked == true)
                {
                    if (DateTime.Now.ToString() == "2009-5-6 02:00:00")
                    {
                        if (alert == null)
                        {
                            alert = new Alert(this.textBox1);
                            alert.ShowDialog();
                            timer1.Enabled = false;
                        }
                    }
                }
            }        private void Form1_Load(object sender, EventArgs e)
            {
                timer1.Enabled = true;
                timer1.Start();
            }
        }
    }
    public Alert(TextBox te)
            {
                InitializeComponent();
                this.text = te;
                this.textBox1.Text = te.Text; 
            }
      

  2.   

    timer  事件在哪?我用VS2005生成了一个网站,在里面看不到timer
      

  3.   

    1楼的是WINFORM的
    你那个光C#无法完成。你打开页面后你页面的生命周期已经结束了。
    用JS实现吧
    SETINTERVAL(FUNCTION(){...},1000);
      

  4.   

    c#还没学好呢,又要学JS?高手们可以说的复杂点么?别那么简单