3
Visual Studio C#Express 2010で、ドキュメントごとにe.Cancelを設定して.Validatingをキャンセルすると、終了時にアプリケーションがハングします。例えば以下を実行し、タイトルバー「X」をクリックしてください。どうすればよいですか.Validating()App Exitがハングするのをキャンセルしますか?
誰かが解決策を知っていますか?ありがとう。
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
namespace WindowsFormsApplication1
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
private void textBox1_Validating(object sender, CancelEventArgs e)
{
e.Cancel = true;
}
}
}
優秀 - ありがとうKragen。 – ChrisJJ