Custom WinForm Inheritance
-
After lots of research I still cant find an effective way of inheriting windows forms from my custom window forms. In Vis Studio 2005 in C# I have a dll project MyWinFormProject which includes a customised winform "MyWinForm" and builds into MyWinFormProject.dll. I have a seperate standard C# windows app project WindowsApplication1. When in WindowsApplication1 I add a new inheriited form Form1 which I want to inherit from MyWinForm. I have been trying 2 ways of doing this: 1. 'Export Template', MyWinForm from MyWinFormProject which creates a zip file. Then go through the Add Item Dialog, but this then exposes all confidential source code of MyWinForm in Form1, which is unsuitable. 2. Go through the Add Item Dialog -> Inheritance Dialog and browse to MyWinFormProject.dll and add this as a reference and inherit from MyWinForm in the componet list. This adds MyWinFormProject.dll to the WindowsApplication1 project bin folder. This approach works fine until I try to add a second winform Form2 inherited from MyWinForm, then I get the error message "Uanble to Add reference......Check a different version of 'MyWinFormProject' is not already referenced. Many thanks Steven Spencer.
-
After lots of research I still cant find an effective way of inheriting windows forms from my custom window forms. In Vis Studio 2005 in C# I have a dll project MyWinFormProject which includes a customised winform "MyWinForm" and builds into MyWinFormProject.dll. I have a seperate standard C# windows app project WindowsApplication1. When in WindowsApplication1 I add a new inheriited form Form1 which I want to inherit from MyWinForm. I have been trying 2 ways of doing this: 1. 'Export Template', MyWinForm from MyWinFormProject which creates a zip file. Then go through the Add Item Dialog, but this then exposes all confidential source code of MyWinForm in Form1, which is unsuitable. 2. Go through the Add Item Dialog -> Inheritance Dialog and browse to MyWinFormProject.dll and add this as a reference and inherit from MyWinForm in the componet list. This adds MyWinFormProject.dll to the WindowsApplication1 project bin folder. This approach works fine until I try to add a second winform Form2 inherited from MyWinForm, then I get the error message "Uanble to Add reference......Check a different version of 'MyWinFormProject' is not already referenced. Many thanks Steven Spencer.