简体   繁体   English

如何在C#和VS2010中实现视觉继承

[英]How to achieve visual inheritance in C# and VS2010

I'm using VS2010 and WinForms, and needs lots of forms for creating/updating data entities. 我正在使用VS2010和WinForms,并且需要大量表单来创建/更新数据实体。 How can I go about creating a base form from which to inherit (Cancel and OK buttons, entity parameters, etc)? 如何创建可继承的基础表单(取消和确定按钮,实体参数等)?

Inheritance in graphical interfaces (especially forms) is not the easiest thing to achieve. 图形界面(尤其是形式)中的继承并不是最容易实现的事情。 You would probably be better off using reusable user controls . 使用可重用的用户控件可能会更好。

It has nothing to do with Entity Framework, but more with the kind of graphical library you're using (assuming Windows Forms, but could be WPF or even WebForms). 它与实体框架无关,而与您正在使用的图形库类型有关(假设使用Windows窗体,但可能是WPF甚至是WebForms)。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM