is Constructor
-
hai guys :) i'm a newbie to C#. My doubt is is 'InitializeComponent()' is somewhat similar to a constructor. Is there any special features with 'InitializeComponent()'. Could anyone share it with me plz. Thanks in advance Long Live :rose:
-
hai guys :) i'm a newbie to C#. My doubt is is 'InitializeComponent()' is somewhat similar to a constructor. Is there any special features with 'InitializeComponent()'. Could anyone share it with me plz. Thanks in advance Long Live :rose:
Sreenivasan Palaniappan wrote: My doubt is is 'InitializeComponent()' is somewhat similar to a constructor. How do you mean ? This method is inserted by the IDE, and called to set all the properties that you set up in the forms designer. As such, you should never mess with the code here, your changes will disappear. as such, it's also a form of construction activity, I guess. But you should add any code of your own in the spot just below the call that is commented as being the right spot to do so. Christian Graus - Microsoft MVP - C++
-
hai guys :) i'm a newbie to C#. My doubt is is 'InitializeComponent()' is somewhat similar to a constructor. Is there any special features with 'InitializeComponent()'. Could anyone share it with me plz. Thanks in advance Long Live :rose:
No ! 'InitializeComponent()' is a common function that run in the form constructor. But in VS.NET IDE this a protected area of code !! If you try to change any line of code in this function IDE will reproduce the original codes at project rebuilds. In fact this is a scope that IDE put the design time initialization of controls and components there. [ _ Always there is another way _ ]