C# 显示一个文本框几秒钟

C# 显示一个文本框几秒钟,c#,visual-studio-2008,.net-3.5,compact-framework,windows-ce,C#,Visual Studio 2008,.net 3.5,Compact Framework,Windows Ce,我正在使用Visual Studio 2008为Windows CE开发一个应用程序,我需要在其中显示一个文本框几秒钟,就像在某些程序中看到的“成功!”弹出消息一样 public partial class Form1 : Form { int s; public Form1() { InitializeComponent(); } private void button1_Click(object sender, EventArgs

我正在使用Visual Studio 2008为Windows CE开发一个应用程序,我需要在其中显示一个文本框几秒钟,就像在某些程序中看到的“成功!”弹出消息一样

public partial class Form1 : Form
{
    int s;

    public Form1()
    {
        InitializeComponent();
    }

    private void button1_Click(object sender, EventArgs e)
    {
        if (s == 1)
        {
            textBox1.Show();
            textBox1.Text = "Success!";
        }
        else
        {
            textBox1.Show();
            textBox1.Text = "Try Again!";
        }

    }
}

考虑到我使用的是.NET3.5紧凑型框架,它显然不支持
System.Windows.Forms.Timer
。有什么解决方案吗?

您可能想使用

提供以指定间隔执行方法的机制。 该类不能被继承

备注

使用TimerCallback委托指定要调用计时器的方法 执行。定时器委托是在启用定时器时指定的 已构造,并且无法更改。该方法不会在上执行 创建计时器的线程;它在线程池线程上执行 由系统提供


您可能想使用

提供以指定间隔执行方法的机制。 该类不能被继承

备注

使用TimerCallback委托指定要调用计时器的方法 执行。定时器委托是在启用定时器时指定的 已构造,并且无法更改。该方法不会在上执行 创建计时器的线程;它在线程池线程上执行 由系统提供


使用classis使用
Messagebox.show(“success!”)不是更好吗?System.Windows.Forms.Timer在.NET CF 3.5中绝对受支持!看到所有的小设备图标了吗?使用classIsn使用
Messagebox.show(“成功!”)不是更好吗?System.Windows.Forms.Timer在.NET CF 3.5中绝对受支持!看到所有的小设备图标了吗?
Timer t = new Timer();
t.Interval = 1000;
timer1.Enabled = true;
timer1.Tick += new System.EventHandler(OnTimerEvent);