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

jquery - How do you format the date used in the popover widget title of FullCalendar? -

Bubble Sort Manually a Linked List in Java -

asp.net mvc - SSO between MVCForum and Umbraco7 -