How Close application with messagebox?

Having problems with building or using the CefSharp .NET binding? Ask your CEF-related questions here. Please ask general usage questions on StackOverflow.

Moderator: amaitland

How Close application with messagebox?

Postby Maksimmkv » Thu Aug 12, 2021 3:48 pm

Hi everyone. I did not find a solution: how to do what would give a window when closing the program: "Yes" or "No." Form_Closing does not work. Thank you


Now work ((((
Code: Select all
private void Form1_FormClosing(object sender, FormClosingEventArgs e) {
   DialogResult dialog = MessageBox.Show(
    "Close?",
    "Close",
    MessageBoxButtons.YesNo,
    MessageBoxIcon.Warning
   );
   if(dialog == DialogResult.Yes) {
    e.Cancel = false;
   }
   else {
    e.Cancel = true;
   }
  }
Maksimmkv
Newbie
 
Posts: 7
Joined: Tue Aug 03, 2021 2:19 pm

Return to CefSharp Forum

Who is online

Users browsing this forum: No registered users and 11 guests