 |
BorlandTalk.com Borland discussion newsgroups
|
| View previous topic :: View next topic |
| Author |
Message |
Mark L. Tiede Guest
|
Posted: Tue Aug 19, 2003 2:39 pm Post subject: How to suppress adding component to DFM |
|
|
Here is a code stub:
procedure TObjectPalette.CreateSheets;
begin
RemoteMonitorSheet := TTabSheet.Create( Self );
with RemoteMonitorSheet do begin
PageControl := Self;
Caption := 'Remote Monitor Objects';
Parent := Self;
end;
I made the owner of TTabSheet be SELF hoping to suppress the writing of the
TTabSheet object to the DFM when the form was saved. It still wrote its
Caption property to the DFM.
How can I suppress that? I don't want any part of that stored in the DFM
because my Create method of the TObjectPalette is going to create another
instance of the TTabSheet again and I end up with TWO of them when I reload
the DFM.
|
|
| Back to top |
|
 |
Mark L. Tiede Guest
|
Posted: Wed Aug 20, 2003 6:25 pm Post subject: Re: How to suppress adding component to DFM |
|
|
Peter,
In my actual code, the TTabSheet was really my own object class. I ended
up overriding the WriteState method in my class. I made it do nothing.
Consequently, the TabSheet object doesn't get written to the DFM. That is
the behavior I wanted.
However, I still don't understand why I even had to do that. I suspect that
when tabsheets have their PageControl property set, they are changed so that
the owner is the Pagecontrol. I couldn't find anything in tracing through
the code that proves that though.
"Peter Thörnqvist" <peter3 (AT) nospam (DOT) peter3.com> wrote
| Quote: | Try creating a new TPageControl descendant where you override GetChildren
and do nothing.
--
Regards,
Peter Thornqvist (JVCL Coordinator)
http://jvcl.sourceforge.net
|
|
|
| Back to top |
|
 |
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|