By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,991 Members | 1,888 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,991 IT Pros & Developers. It's quick & easy.

Problem with overloaded constructor

P: 2
I have written a component called PlotPanel which inherits from System.Windows.Forms.Panel. When the control is used in the design window the default constructor "this.plotPanelReal = new PlotPanel();" is generated in "Windows Form Designer generated code". I want to use an overloaded constructor instead: "this.plotPanelReal = new SEA.PlotPanel(nbXMin, nbXMax, nbYMin, nbYMax);" (nbXXXX is number boxes which inherits from TextBox).

If I just change the row "this.plotPanelReal = new PlotPanel();" in "Windows Form Designer generated code" to "this.plotPanelReal = new SEA.PlotPanel(nbXMin, nbXMax, nbYMin, nbYMax);" it works until I do some changes in the designer then row is changed to the default constructor again.

If I just leave the row "this.plotPanelReal = new PlotPanel();" in "Windows Form Designer generated code" and instead place "this.plotPanelReal = new SEA.PlotPanel(nbXMin, nbXMax, nbYMin, nbYMax);" in, for example, the constructor of the main class the arguments is not making any difference. The reference of the number boxes is not passed to the PlotPanel object.

Please, help needed

/Anders
Apr 26 '07 #1
Share this question for a faster answer!
Share on Google+

Post your reply

Sign in to post your reply or Sign up for a free account.