What is the easiest way of getting Delphi to accept a newly added file as a frame and to treat it as such? – Stack Overflow
Posted by jpluimers on 2020/02/26
As this is still an issue with current Delphi versions: every now and then it looses which designers are needed for a frame:
[WayBack] What is the easiest way of getting Delphi to accept a newly added file as a frame and to treat it as such? – Stack Overflow (by Brian Frost)
<DCCReference Include="x\y\z\myFrame.pas"> <Form>frameMy</Form> <FormType>dfm</FormType> <DesignClass>TFrame</DesignClass> </DCCReference>
Then check your .dfm
file to see if it starts with the correct inherited
or object
as per Delphi – TInterfacedDataModule revisted – use ‘inherited’ in your .dfm files when your datamodules look like forms in the designer.
Oh and at design time, be very careful embedding frames. Better not to do it at all and for certain: do not embed frames in a nested way: [WayBack] Frames in 10.2.2 Hi Has anyone else had issues with frames under 10.2.2? The project seems to have lost its links to the frames? If I went to the Too… – Vince Bartlett – Google+
–jeroen
Steven Kamradt said
I also had problem using TCardPanel on a frame recently. It seemed ok in the designer at first, but then when I reloaded it lost track of the cards and required surgical DFM work to recover the rest of the frame. This seemed to be isolated to one session. Using a tForm and embedding at runtime seems to work much more reliably than embedding frames. In my case I was loading frames/forms into a tStackPanel embedded in a scrollbox. If your adding duplicates, just make sure that the frame/form names get changed to something unique. For me the easiest way was to keep an integer form variable that I incremented with each add and appended to the existing name.