I'm using VS2010 and WinForms, and needs lots of forms for creating/updating data entities. How can I go about creating a base form from which to inherit (Cancel and OK buttons, entity parameters, etc)?
Asked
Active
Viewed 1,126 times
1
-
Cancel and OK buttons sound like part of the UI and shouldn't have anything to do with entity framework. Do you think you can explain the problem better? – Jarrett Widman Sep 06 '10 at 23:27
-
1He's saying that he's building a UI around an EF-based application and will need a lot of similar UI dialogs. E.g. can he reuse portions of various forms (to include things like Cancel and OK buttons, along with, I'm sure, logic around save/delete/add, etc.) – Robaticus Sep 06 '10 at 23:30
-
Well explained Robaticus; yes, I just want to avoid writing dozens of "OnClickOK()" code and such, so I just need to write the custom 'per entity class' display and editing code. – Jay Sep 06 '10 at 23:32
-
edit: removed EF reference, added WinForms. – Jay Sep 07 '10 at 04:56
1 Answers
1
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).

Xavier Poinas
- 19,377
- 14
- 63
- 95
-
Apparently my mention of EF is distracting. You are right, it has nothing to do with EF. I'm using Windows Forms, have done almost nothing with UI for years, but remembered (vaguely) visual inheritance being touted years past, probably in VB. – Jay Sep 06 '10 at 23:34