在多级继承中获得错误。 [英] getting error in multilevel inheritence.

查看:53
本文介绍了在多级继承中获得错误。的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我用一些虚方法创建了一个公共类。此类继承System.windows.forms.form类。当这个公共类继承由表单设计者而不是设计表单并给出错误:

I have created an common class with some virtual methods. this class inheriting System.windows.forms.form class. When this common class inheriting by a form designer not designing form and giving error :

时,无法为此文件显示设计器,因为其中的所有类都不能设计。设计师检查了文件中的以下类:IR_validation--基类IRvalidations.common 无法加载。确保已经引用了程序集
并且已经构建了所有项目。

the designer could not be shown for this file because none of the classes within it can be designed. the designer inspected the following classes in the file: IR_validation-- the base class IRvalidations.common  could not be loaded. Ensure the assembly has been referenced and that all projects have been built.

请在此建议。注意,Naveen

Please suggest on this.Regards,Naveen

推荐答案

嗨KUMAR,

Hi KUMAR,

我无法理解你。我尝试
重现
您的 根据您的描述错误。首先,我创建了一个类。

I can't understand you clearly. I tried to reproduce your error according to your description. Firstly, I create a class.

public class MyBaseForm : System.Windows.Forms.Form
{
    public virtual void AMethod()
    {
        
    }
    public virtual void BMethod()
    {
    }
}

然后我添加一个名为Form1的新表单并更改设计类并让它继承自MyBaseForm。

Then I add a new form named Form1 and change the design class and let it inheriting from MyBaseForm.

partial class Form1 : MyBaseForm
{
}

重建我的项目。没有错误发生。请检查是否还有其他错误。

Rebuild my project. No error occurs. Please check if there other errors occured.

最好的问候,

李旺

Best Regards,
Li Wang


这篇关于在多级继承中获得错误。的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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