mahesh waghela

mahesh waghela

  • NA
  • 93
  • 112.8k

A Bug Related To Form Constructor

Jun 19 2011 8:50 AM
Passing a reference to the Form Constructor is it a bug?

e.g.

Form4  form4

Public Form1(Form4 form4)
{
this.form4=form4
Initializecomponent();
}

I want to draw the attention of our community members to the confusion surrounding the passing of references into form constructors. I am always against passing a reference to the form constructor.

It is important to know what is a Form Constructor before preparing to write a big project.

According to the MSDN article:

The Form Constructor "Initialises a new instance of the Form class"

I think we can all agree on this definition. Knowing this I want to ask is it bad practice to pass a reference to the Form Constructor in large projects? And Is it a Bug To Write A Reference To The Form Constructor?

The reason I ask is because in big projects a particular form is not stand alone. It may have many relationships with other forms up to 10,20 or even 30+. So passing a reference to Form Constructor causes an "overload method error."


Answers (26)