Form inheritance - how is it achieved?


Author
Message
Peter Jones
Peter Jones
Advanced StrataFrame User (718 reputation)Advanced StrataFrame User (718 reputation)Advanced StrataFrame User (718 reputation)Advanced StrataFrame User (718 reputation)Advanced StrataFrame User (718 reputation)Advanced StrataFrame User (718 reputation)Advanced StrataFrame User (718 reputation)Advanced StrataFrame User (718 reputation)Advanced StrataFrame User (718 reputation)
Group: Forum Members
Posts: 386, Visits: 2.1K
Hi,

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_01
End 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

Reply
Trent Taylor
Trent Taylor
StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)
Group: StrataFrame Developers
Posts: 6.6K, Visits: 7K
Ivan is exactly correct here.  The StrataFrame Maintenance for is nothing more than an SF StandardForm with a Gradient Form Header and MaintenanceToolStrip already dropped on it.  This is all setup in a template file.

The easiest way to achieve what you are trying to do is to create your own template that already has the controls and code "pre-built" which gives you a big leg up when developing your specific application.

All item template files are actually stored in a ZIP in the following location:

C:\Program Files\Microsoft Visual Studio 8\Common7\IDE\ItemTemplates\VisualBasic

or

C:\Program Files\Microsoft Visual Studio 8\Common7\IDE\ItemTemplates\CSharp

You can extract these template files and open up the internal files to see what is done.  You can then create a form or other control to your liking and create your own ZIP file with the contained contents.

Once you have the ZIP file created and placed in the same folder as mentioned above (be sure to create a unique template name and ZIP file name) then you need to install it.  To do this close down Visual Studio, go to the Visual Studio command prompt and type:

devenv.exe /setup

Once complete your template will then be installed when you go back into Visual Studio.

GO

Merge Selected

Merge into selected topic...



Merge into merge target...



Merge into a specific topic ID...




Threaded View
Threaded View
Peter Jones - 18 Years Ago
Ivan George Borges - 18 Years Ago
Trent L. Taylor - 18 Years Ago
Greg McGuffey - 18 Years Ago
Trent L. Taylor - 18 Years Ago
Greg McGuffey - 18 Years Ago
Peter Jones - 18 Years Ago
Peter Jones - 18 Years Ago
Ivan George Borges - 18 Years Ago
Trent L. Taylor - 18 Years Ago
Greg McGuffey - 18 Years Ago
Peter Jones - 18 Years Ago
Ivan George Borges - 18 Years Ago
StrataFrame Team - 18 Years Ago
StrataFrame Team - 18 Years Ago
                         One last thing... there's an Export Template Wizard that can be...
StrataFrame Team - 18 Years Ago
Peter Jones - 18 Years Ago
             Hey Peter. Glad to hear that. ;)
Ivan George Borges - 18 Years Ago

Similar Topics

Reading This Topic

Login

Explore
Messages
Mentions
Search