C# WPF-Ask user before closing application if right-clicking the application icon on the system task bar -


let click close button in application , popup dialog box yes , no option. how can implement (popup dialog box ask user whether want close application) if close application right-clicking application icon on system task bar?

subscribe closing event in mainwindow:

public mainwindow() {     initializecomponent();     closing += onclosing; }  private void onclosing(object sender, canceleventargs canceleventargs) {     if (messagebox.show(this, "your message", "confirm", messageboxbutton.yesno) != messageboxresult.yes)     {         canceleventargs.cancel = true;     } } 

Comments

Popular posts from this blog

python - Installing PyDev in eclipse is failed -

PHP OOP-based login system -

c# - Nested Internal Class with Readonly Hashtable throws Null ref exception.. on assignment -