using System; using System.Drawing; using System.Windows.Forms; using System.ComponentModel; public class Program : Form { public Program() { Closing += new CancelEventHandler(AuthForm_Closing); CenterToScreen(); Width = 300; Height = 200; } protected void AuthForm_Closing(object sender, CancelEventArgs e) { DialogResult dr = MessageBox.Show("Biztosan be akarod zárni?", "Kilépés esemény!", MessageBoxButtons.YesNo); if (dr == DialogResult.No) e.Cancel = true; else e.Cancel = false; } public static void Main() { Application.EnableVisualStyles(); Application.SetCompatibleTextRenderingDefault(false); Application.Run(new Program()); } }