.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

Popular posts from this blog

javascript - Jquery show_hide, what to add in order to make the page scroll to the bottom of the hidden field once button is clicked -

javascript - Highcharts multi-color line -

javascript - Enter key does not work in search box -