Sunday, 15 June 2014

vb.net - Closing application using FormClosing() -



vb.net - Closing application using FormClosing() -

what i'm trying when press x button on application, application delete files , close self. unfortunately can't work without asking me questions before quitting application self.

private sub form1_formclosing(byval sender object, byval e system.windows.forms.formclosingeventargs) handles me.formclosing system.io.directory.delete(my.computer.filesystem.specialdirectories.temp + "/reach_dt", true) close() end sub private sub form1_formclosing(sender object, e system.windows.forms.formclosingeventargs) handles me.formclosing select case messagebox.show("are sure want exit?", "confirm", messageboxbuttons.yesno, messageboxicon.question) case windows.forms.dialogresult.yes case windows.forms.dialogresult.no e.cancel = true end select end sub

i think, although not clear question, you're getting question asked twice (or more) maybe?

in case, remove close() call. in close event, , attempts close form 1 time again.

the form automatically close when event processing done, long e.cancel not true.

vb.net visual-studio-2010 visual-studio

No comments:

Post a Comment