Public Sub New() in Windows Form Designer generated code

  • Thread starter Thread starter Melson
  • Start date Start date
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
 
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

Back
Top