VB.NET application questions on Form_Load
Posted on 2011-03-16
I am trying to write a program that eventually will be running with no form present. Currently I have a form with few buttons for testing. I am not a vb.net programmer so looking for some insights.
I currently have the majority of the code in Form_Load and have an IF statement which should stop the execution of the program and close it. I tried multiple options, .Close(), .Exit(), .Dispose() with Me. or Form. which is executed but then continues on the next line.
I've tried calling a function within Form_Load and then including the Exit code but that did not work either.
Also tried Form_Paint function but that also just destroys the Form, but does not stop execution of the program.
The end-goal is to have the program execute on just double-clicking on it, no forms present and if specific condition arises, stop and close the execution.
Please be as specific as possible.
I hope this makes sense.