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
Post a Comment