Public Sub New() in Windows Form Designer generated code

M

Melson

Hi

I've realised that whenever I declare this sentence, "dim newform as new
mainform" in another form, the Public Sub New() in Windows Form Designer
generated code in mainform will automatically run.

May I know is there a way to prevent it running again. Thanks.

Regards
Melson
 
R

Robin Tucker

Whats happening here is New is being run to construct that particular
instance of your form. You do not want to prevent this happening.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top