i know that in vb.net you can just do Exit Sub
but i would like to know how do i exit a click event in a button?
here\'s my code:
pr
There are two ways to exit a method early (without quitting the program):
i) Use the return keyword.
ii) Throw an exception.
Exceptions should only be used for exceptional circumstances - when the method cannot continue and it cannot return a reasonable value that would make sense to the caller. Usually though you should just return when you are done.
If your method returns void then you can write return without a value:
return;