c# - Make actions on form1 close -


I was trying to save a file at the end of the program

  private void Form 1_formclas (Object Sender, FormClosedEventArgs E) {tabelaEC0.WriteXml (current directory, XmlWriteMode.WriteSchema); Application.Exit (); }   

In this case it does not save the file (tried with any other button and worked perfectly) then the problem is form 1 closed, any signal?

Update: ::

I have created an extraordinary method to save the file, such as

  Public Weed Funfocus (EventErgues E) {table .WriteXml (@ "C: /file.xml", XmlWriteMode.WriteSchema); }   

And so I'm hooking it on FormClosing

  Private Zero Form 1_formCalling (Object Sender, FormClosingEventArgs e) {Form1.Close () + = funcaofecho; }   

I believe how this should have been done, but there is no sign in "item reference"?

You are using Telivecy, which I think is a control in your form. If this is the case then the control has been destroyed because this form has already been closed when that incident is removed.

Try it on Form_Closing.

Comments

Popular posts from this blog

Verilog Error: output or inout port "Q" must be connected to a structural net expression -

jasper reports - How to center align barcode using jasperreports and barcode4j -

c# - ASP.NET MVC - Attaching an entity of type 'MODELNAME' failed because another entity of the same type already has the same primary key value -