I have several forms in a C# application. I use Visual Studio 2010 Beta, but .NET 3.5 and C# 3.
I have a base form, called FilteredQueryViewForm in the Shd namespace and I want some other forms to inherit it (because they will basically do the same stuff, but with some additions).
I changed things from private to protected in the FilteredQueryViewForm class, so they're accessible from the derived forms. After this I've created a derived form and set the base class to FilteredQueryViewForm.
The designer of the derived class complained about Shd.FilteredQueryViewForm not having any constructors... regardless of the fact it had one, with 3 parameters. I thought parameters can be a problem, so I also created a (public, of course) constructor without parameters, but it still doesn't work. The error message is the same:
"Constructor on type 'Shd.FilteredQueryViewForm' not found."
And the designer of the derived class won't load. I have tried restarting vs2010beta, re-creating the derived form, but nothing seem to help. Google didn't yield any useful results for me on this problem. :(
Is this a problem of Visual Studio 2010 Beta? Or am I doing something wrong?
You will need a constructor without parameters which calls the InitializeComponent() method in every of your forms. Then close the designer window, rebuild the solution and try to reopen the designer. That should work. Rebuilding the solution is essential.
The problem is, that if you create a form that inheritates from Shd.FilteredQueryViewForm, the designer will try to call the constructor of the parent form, but it loads this form not from code but from it's built assembly.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With