⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 frmkeepitup.cs

📁 清华大学出版社出版的 移动应用开发宝典 张大威(2008)的附书源代码
💻 CS
字号:
using System;
using System.Windows.Forms;
using System.Threading;

namespace CodeForChapter11cs
{
  // Only run this from within the IDE with F5
  public partial class frmKeepItUp : Form
  {
    public frmKeepItUp()
    {
      InitializeComponent();
    }

    // start thread that will block
    private void menuItem1_Click(object sender, EventArgs e)
    {
      Thread t = new Thread(new ThreadStart(this.KeepTheProcessUp));
      //t.IsBackground = true;
      t.Start();

      MessageBox.Show("Hit the Exit button. Is VS still debugging");
    }

    private void KeepTheProcessUp()
    {
      ManualResetEvent mre = new ManualResetEvent(false);
      mre.WaitOne();
      MessageBox.Show("Never shown!");
      // imagine more code
    }

    //Exit
    private void menuItem2_Click(object sender, EventArgs e)
    {
      this.Close();
      Application.Exit(); // utterly superfluous but just to emphasize the point!
    }
  }
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -