init_dotnet() using System.Windows.Forms Sub onClose(sender, args) If MsgBox("Closing " & sender.ToString() & " " & args.ToString(), 33, "Information") = 1 Then args.Cancel = False Else args.Cancel = True End If End Sub Dim top, initSz Set top = Form() top.Text = "XCircuit .NET event demo" top.Closing = GetRef("onClose") Set initSz = System.Drawing.Size(500,500) top.ClientSize = initSz top.Show()