由于继承了抽象类而禁用了设计器? [英] Disabled designer due to inheriting abstract class?

查看:74
本文介绍了由于继承了抽象类而禁用了设计器?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个项目的解决方案。在那个项目中,有40或50种形式的活动。我已经制作了4种其他所有表格都可以继承的基本表格。这些基本表单的全部4个都继承System.Windows.Forms.Form。几乎90%的表格都继承了前两个基本表格之一。其余的继承了最后一个2。但是现在我突然冒了这个错误,我用最后2个基本形式制作了3个编,而当我制作第5个基本形式时,出现了此错误,并且禁用了设计器。

I have a solution with one project. In that project are something live 40 or 50 forms. I've made 4 base forms that all the other forms can inherit. All 4 of those base forms inherit System.Windows.Forms.Form. Almost 90% of the forms inherit one of the first 2 base form. The rest inherits one of the last 2. But now I got this error out of nowhere, I made like 3 progs with the last 2 base forms and while I'm making the 5th, this errors occures and the designer is disabled.


设计者必须创建一个类型为'xxxxxxx.frmBaseCr'的实例,但不能,因为该类型被声明为抽象。

The designer must create an instance of type 'xxxxxxx.frmBaseCr' but it cannot because the type is declared as abstract.

我该如何解决?我已经在Google上搜索了多个小时,但找不到任何可行的解决方案。我已经尝试了#if #else #endif语句,但这似乎不起作用。我正在Visual Studio 2012 Express中工作。

How an I solve this? I've searched on google for many hours now but I just can't find any working solution. I've tried the #if #else #endif statement but that doesn't seem to be working. I'm working in Visual Studio 2012 Express.

推荐答案

您需要删除 MustInherit 关键字。

这篇关于由于继承了抽象类而禁用了设计器?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆