﻿<?xml version="1.0" encoding="UTF-8"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/"><channel><title>StrataFrame Forum » Updates and Information » StrataFrame Users Contributed Samples  » Example of how to use a base form</title><generator>InstantForum 2017-1 Final</generator><description>StrataFrame Forum</description><link>http://forum.strataframe.net/</link><webMaster>StrataFrame Forum</webMaster><lastBuildDate>Mon, 08 Jun 2026 22:06:08 GMT</lastBuildDate><ttl>20</ttl><item><title>Example of how to use a base form</title><link>http://forum.strataframe.net/FindPost12693.aspx</link><description>This is an example of how to sub class the SF StandardForm to add functionality beyond what SF provides. I'm providing an example of some functionality that I needed, but of course, you may need vastly different features. Hopefully this might help in figuring out an elegant and pragmatic solution for you also! &lt;br&gt;
&lt;br&gt;
I found myself very often coding the following features into a form:&lt;br&gt;
&lt;br&gt;
- setting the title of the form to reflect the current record&lt;br&gt;
- constructors that took the ID of a record that was passed to it, then loaded that single record into the form's BO.&lt;br&gt;
- constructors that took a boolean that indicated I wanted to add a new record when the form opens.&lt;br&gt;
&lt;br&gt;
I also need the ability to pass in a BO or data table with the data the form would use.&lt;br&gt;
&lt;br&gt;
After doing this a few too many times, the light bulb went off and I realized there must be a better way.  I then started to investigate how to use a base form.  SF provided the example. The StandardForm inherits the SF BaseForm, which in turn provides all the SF niceness that we love. Why couldn't I do that myself and add my extra features?  :D&lt;br&gt;
&lt;br&gt;
So, I coded a base form that added the features mentioned. Now when I need one or more of those features, I just inherit from my base form (which inherits from StandardForm...so I have the SF features too).  &lt;br&gt;
&lt;br&gt;
When the solution opens, an explanation page is shown that should help you get started.&lt;br&gt;
&lt;br&gt;
For a savvy .NET developer, this is pretty basic stuff.  However, a lot of us are moving from some other language/paradigm. So I thought I'd offer this up, as it might help to have a practical example of using a base class (plus some generic shared factory methods, how to hook into the SF events (see the OnLoad method)).&lt;br&gt;
&lt;br&gt;
Of course, all of you savvy, svelte .NET gurus out there could certainly pipe in with suggestions for improvements or trade offs of doing things differently...I'm always learning more!&lt;br&gt;
&lt;br&gt;
Thanks!&lt;br&gt;
Greg  :cool:&lt;br&gt;
&lt;br&gt;
P.S. You'll need the StrataFrameSample db loaded for this to work.</description><pubDate>Thu, 15 Nov 2007 15:37:19 GMT</pubDate><dc:creator>Greg McGuffey</dc:creator></item><item><title>RE: Example of how to use a base form</title><link>http://forum.strataframe.net/FindPost12730.aspx</link><description>Glad it turned out that simple of a problem!</description><pubDate>Thu, 15 Nov 2007 15:37:19 GMT</pubDate><dc:creator>Greg McGuffey</dc:creator></item><item><title>RE: Example of how to use a base form</title><link>http://forum.strataframe.net/FindPost12726.aspx</link><description>I got it. Make sure you are logged in before downloading!</description><pubDate>Thu, 15 Nov 2007 13:58:15 GMT</pubDate><dc:creator>Michael Reese</dc:creator></item><item><title>RE: Example of how to use a base form</title><link>http://forum.strataframe.net/FindPost12710.aspx</link><description>Hey Greg.&lt;/P&gt;&lt;P&gt;Very nice!&lt;/P&gt;&lt;P&gt;Thanks. ;)</description><pubDate>Wed, 14 Nov 2007 19:51:45 GMT</pubDate><dc:creator>Ivan George Borges</dc:creator></item><item><title>RE: Example of how to use a base form</title><link>http://forum.strataframe.net/FindPost12709.aspx</link><description>I was able to download from home, thanks Greg.</description><pubDate>Wed, 14 Nov 2007 18:45:11 GMT</pubDate><dc:creator>Keith Chisarik</dc:creator></item><item><title>RE: Example of how to use a base form</title><link>http://forum.strataframe.net/FindPost12704.aspx</link><description>For those who may not know.&amp;nbsp; You can get tricky and add it to the New Item dialog as well via Templates as well.&amp;nbsp;&amp;nbsp; Just search VSTemplates or look in C:\Program Files\Microsoft Visual Studio 8\Common7\IDE\ItemTemplates\&amp;nbsp; for some samples.&lt;/P&gt;&lt;P&gt;Richard</description><pubDate>Wed, 14 Nov 2007 13:42:47 GMT</pubDate><dc:creator>Richard Keller</dc:creator></item><item><title>RE: Example of how to use a base form</title><link>http://forum.strataframe.net/FindPost12700.aspx</link><description>I have downloaded the&amp;nbsp;attachment with IE without any problems.&lt;/P&gt;&lt;P&gt;And Greg - it&amp;nbsp;is&amp;nbsp;a very good sample with some functionality&amp;nbsp;that i can use in my current application.&lt;/P&gt;&lt;P&gt;Thx.&lt;/P&gt;&lt;P&gt;Teddy</description><pubDate>Wed, 14 Nov 2007 11:39:02 GMT</pubDate><dc:creator>Teddy Jensen</dc:creator></item><item><title>RE: Example of how to use a base form</title><link>http://forum.strataframe.net/FindPost12699.aspx</link><description>Hmmm....that is weird.  I have no problem with the attachment.  Anyone else?  Maybe its a setting in IE/firefox or a proxy issue?</description><pubDate>Wed, 14 Nov 2007 11:28:49 GMT</pubDate><dc:creator>Greg McGuffey</dc:creator></item><item><title>RE: Example of how to use a base form</title><link>http://forum.strataframe.net/FindPost12695.aspx</link><description>I would love to download this, thanks Greg.&lt;/P&gt;&lt;P&gt;When I click the link to download I am just taken back to the main forum listing page, right click and save as gives a .html page. I have tried in IE and Firefox.&lt;/P&gt;&lt;P&gt;I have had this issue with attachments for a while now. Help appreciated.</description><pubDate>Wed, 14 Nov 2007 09:45:17 GMT</pubDate><dc:creator>Keith Chisarik</dc:creator></item></channel></rss>