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

asp.net mvc - SSO between MVCForum and Umbraco7 -

Python Tkinter keyboard using bind -

ubuntu - Selenium Node Not Connecting to Hub, Not Opening Port -