.NET inherited (WinForms) Form - VS designer issue

后端 未结 5 705
后悔当初
后悔当初 2020-12-11 02:45

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

5条回答
  •  误落风尘
    2020-12-11 03:27

    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.

提交回复
热议问题