VB.Net - Close a form
-
I wonder if anyone can help me solve this problem. On a form load, I do a simple yes/no test. If I say No, then I want to close the form I am loading. I have tried Unload, me.Close, formname.Close but with no success. Keep getting errors. Is the problem with the Load event? I have tried closing the form from a procedure I created but no luck. I am properly doing something really stupid or missing sometning simple out.
-
I wonder if anyone can help me solve this problem. On a form load, I do a simple yes/no test. If I say No, then I want to close the form I am loading. I have tried Unload, me.Close, formname.Close but with no success. Keep getting errors. Is the problem with the Load event? I have tried closing the form from a procedure I created but no luck. I am properly doing something really stupid or missing sometning simple out.
directred wrote:
On a form load, I do a simple yes/no test. If I say No, then I want to close the form I am loading
It's a bit late to do the decision in that point. Could you modify the opening logic so that you don't open the form at all if your test fails (don't even create it).
directred wrote:
Is the problem with the Load event
I think it's by design.
The need to optimize rises from a bad design.My articles[^]
-
I wonder if anyone can help me solve this problem. On a form load, I do a simple yes/no test. If I say No, then I want to close the form I am loading. I have tried Unload, me.Close, formname.Close but with no success. Keep getting errors. Is the problem with the Load event? I have tried closing the form from a procedure I created but no luck. I am properly doing something really stupid or missing sometning simple out.
Please copy and paste the error messages so that I can help you Cheers Marcello Turnbull
-
I wonder if anyone can help me solve this problem. On a form load, I do a simple yes/no test. If I say No, then I want to close the form I am loading. I have tried Unload, me.Close, formname.Close but with no success. Keep getting errors. Is the problem with the Load event? I have tried closing the form from a procedure I created but no luck. I am properly doing something really stupid or missing sometning simple out.