.net - Which is the proper way to end the execution of the application inside a constructor block? -
i've noticed if try use application.exit
instruction inside constructor sub not take effect, should proper way end execution of application in circunstances?
i know use application events cancel startup
event, or wait load
or shown
event exit application calling application.exit
method, i'm asking learn proper way in constructor sub without using end
statement, in case possibly.
this example:
public class form1: inherits form ''' <summary> ''' initializes new instance of <see cref="form1"/> class. ''' </summary> public sub new() application.exit ' end end class
environment.exit(0) trick.
Comments
Post a Comment