init_dotnet();
using(System.Windows.Forms);

function onClose(sender, args)
{
	result = MessageBox.Show('Closing ' + sender.ToString() + ' ' + args.ToString(),
				'Information',
				MessageBoxButtons.OKCancel);
	if (result.Equals(DialogResult.OK))
		args.Cancel = false;
	else
		args.Cancel = true;
}

top = new Form();
top.Text = 'XCircuit .NET event demo';
top.Closing = onClose;

top.Show();
