c# - "do not ask me again" in confirmation popup -


I have an application of windows that have ow windows. When I close the form, I want to add a confirmation box that says "Do you want to close this form?" How can I confirm the post-popup in C # in "Do not ask again"?

First of all you have a solution in a class , _yes > to memorize the user's preferences _askUserAgain with public properties three static public properties which I have created and _no .

  public class confirmation {public static bull _askUserAgain = true; Public static bool _yes = false; Public Stable Bull _no = false; }   

If (confirmation ._askUserAgain == true) {E.Canel = true; Form 2 Form 2 = New Form 2 (); Form2.Show (); } And {e. Canal = false; }}

The next Fomr2 is shown as:

 form2

  Private Zero checkbox box checked (object sender, EventArgs e) {confirmation._askUserAgain = false; } Private Zero Yes_Click (Object Sender, EventArgs e) {confirmation._yes = true; Confirmation. _no = incorrect; Form 1 parentform = application Open Form [Form 1]] as Form 1; If (parent! = Null) {parentForm.Hide (); } This.Hide (); } Private Zero No_Click (Object Sender, EventArgs e) {confirmation._no = true; Confirmation._Yes = false; If (confirmation._no) {this.Hide (); Form 1 parentform = application Open Form [Form 1]] as Form 1; ParentForm.Show (); }}    

Comments

Popular posts from this blog

Pass DB Connection parameters to a Kettle a.k.a PDI table Input step dynamically from Excel -

multithreading - PhantomJS-Node in a for Loop -

c++ - MATLAB .m file to .mex file using Matlab Compiler -