I was hoping I could create a "base" SF Maintenance form that will contain standard code and components, e.g. DefaultLookAndFeel, then inherit this form whenever I create a new form. I have my base form called frmBase_01 and, the code in my test form that is trying use the base form is:
Public Class frmBase_02 Inherits TMS_Test_01.frmBase_01End Class
This generate the error:"Error 1 Base class 'frmBase_01' specified for class 'frmBase_02' cannot be different from the base class 'MicroFour.StrataFrame.UI.Windows.Forms.StandardForm' of one of its other partial types. C:\Documents and Settings\pmj\My Documents\Visual Studio 2005\Projects\TMS_Test_01\TMS_Test_01\frmBase_02.vb"
Try as I may I just can't stumble my way past this error - can you please point me in the right direction. The recent work I've done with creating a "base" BO class works great but I notice that, for forms, the inheritence is in the partial class - I guess this is a fundemental difference that stops my base BO approach working when trying to achieve the same outcome for a form.
Cheers, Peter
Thanks for the help - I'm currently working my way through Ivan's feedback. I've extracted the existing template and copy/pasted info from my new form then zipped up the files into a new, uniquely named, zip file and copies it back into: C:\Program Files\Microsoft Visual Studio 8\Common7\IDE\ItemTemplates\VisualBasic.
I didn't know what was meant by Trent's instruction to go the Visual Studio command prompt but Google to the rescue and I followed the Start>Programs>Visual Studio 2005>Visual Studio Tools and found the command prompt in there. I click this and simply ended up in command window in C:\program files\Microsoft Visual Studio 8\VC. Given that my code is VB I changed the directory to: ..\VB and entered devenv.exe /setup. This seemed to run ok but when I started VS again the only templates I have are: Inherited Form and Inherited User Control.
Contary to all instructions I paniced and went back into the ..\VB directory and entered the devenv command again. No errors but still no templates. I then checked the event log which told me the command I needed was devenv/installvstemplates. However doing this in both the VC and VB directories had no effect.
Any clues on how I recover from this self inflicted wound?
Ivan, specifically on what you have done - its seems to be great approach but have you ever tried changing ProFilmeNET_Base.UI.Windows.Forms.PFNStandardForm and seen the changes perculate through on a rebuild of your app?
Hi Peter, have you seen Pertti's post? http://forum.strataframe.net/Topic7973-10-1.aspx
Yes, I have. So far, so good. But I'm not talking about visual inheritance, which seems to be a problem in VS.
So, if anyone answered this question in the tons of posts on this thread, thanks, but I was just skimming the thread and it didn't looked like all of the discussion was around templates. Templates are great, and we have several for our projects, but all of our forms also inherit from a base form that is specific to the application... so you really need both.
Put the .zip file for the template in {My Documents}\Visual Studio 2005\Templates\ItemTemplates\Visual Basic. This folder is much more user friendly than the other one for several reasons:
1) Your template shows up under it's own grouping called "My Templates" at the bottom of the Add New Item dialog, not mixed in with all of the others.
2) You don't have to close Visual Studio, call devenv.exe /setup and then reopen visual studio... just re-open the Add New Item dialog and the template will be re-read.
When we do a custom template for use with one of our commercial products, we don't generally put it in the folder with all of the installed templates for those reasons. It's a whole lot easier to tweak your template if you don't constantly have to close VS to run devenv.exe /setup just to reinstall your template
If you can't reach the wizard from the file menu, then you'll have to add the command to your menu by right-clicking somewhere on the toolbars within VS and choose Customize... at the bottom. The "Export Template..." command is under the File category. Just drag it out onto the toolbar or menu where you want it.