Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>Registering your frames as a component solves both 1. and 2.: </p> <ol> <li>the components on the frame are locked when you put that frame control on a form or other frame</li> <li>you will get a component (actually: control) that you can design visually</li> </ol> <p>But: there are a few catches (which can be solved, see article link), of which the most important is this one:</p> <p><strong>When you put components on your frame, and later drop that frame as a component on a Delphi form or frame, the components are visible in the Structure Pane.</strong></p> <p>The problem is that because they are visible in the structure pane, you can delete them, causing access violations.</p> <p>The trick to solve this to <a href="http://wiert.wordpress.com/2009/07/16/delphi-frames-as-visual-components-dont-forget-your-sprig/" rel="noreferrer">not forget the 'sprig'</a>.<br> I learned that valuable lesson from <a href="http://www.raize.com/Events.asp" rel="noreferrer">Ray Konopka</a> during <a href="http://delphilive.com/" rel="noreferrer">DelphiLive</a> 2009.</p> <p>Since the lesson is so valuable, I wrote a <a href="http://wiert.wordpress.com/2009/07/16/delphi-frames-as-visual-components-dont-forget-your-sprig/" rel="noreferrer">blog post</a> on it that describes it in detail.</p> <p>The essential portion is this little piece of code (more details in the blog post):</p> <pre><code>procedure RegisterFramesAsComponents(const Page: string; const FrameClasses: array of TFrameClass); var FrameClass: TFrameClass; begin for FrameClass in FrameClasses do begin RegisterComponents(Page, [FrameClass]); RegisterSprigType(FrameClass, TComponentSprig); end; end; </code></pre> <p>Hope this helps.</p> <p>--jeroen</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload