I wrote a TCustomFrame
's child class which has been exactly copied from TFrame
(Forms.pas unit):
TMyFrame = class(TCustomFrame)
private
{ Private declarations }
public
{ Public declarations }
published
property Align;
property Anchors;
property AutoScroll;
property AutoSize;
property BiDiMode;
property Constraints;
property DockSite;
property DragCursor;
property DragKind;
property DragMode;
property Enabled;
property Color nodefault;
property Ctl3D;
property Font;
property Padding;
property ParentBackground default True;
property ParentBiDiMode;
property ParentColor;
property ParentCtl3D;
property ParentFont;
property ParentShowHint;
property PopupMenu;
property ShowHint;
property TabOrder;
property TabStop;
property Visible;
property OnAlignInsertBefore;
property OnAlignPosition;
property OnCanResize;
property OnClick;
property OnConstrainedResize;
property OnContextPopup;
property OnDblClick;
property OnDockDrop;
property OnDockOver;
property OnDragDrop;
property OnDragOver;
property OnEndDock;
property OnEndDrag;
property OnEnter;
property OnExit;
property OnGetSiteInfo;
property OnMouseActivate;
property OnMouseDown;
property OnMouseEnter;
property OnMouseLeave;
property OnMouseMove;
property OnMouseUp;
property OnMouseWheel;
property OnMouseWheelDown;
property OnMouseWheelUp;
property OnResize;
property OnStartDock;
property OnStartDrag;
property OnUnDock;
end;
As described here, I've initially defined a TFrame
's child class, then I've switched to TCustomFrame
and removed the TabOrder
property from the DFM in order to be able to open the file in the IDE and recompile the package.
object MyFrame: TMyFrame
Left = 0
Top = 0
Width = 296
Height = 31
TabOrder = 0 //this line has been deleted
end
Everything seemed to be ok but after opening and saving the source file, there were several new properties in the DFM and a titlebar appears:
object MyFrame: TMyFrame
Left = 0
Top = 0
ClientHeight = 0
ClientWidth = 280
Color = clBtnFace
Font.Charset = DEFAULT_CHARSET
Font.Color = clWindowText
Font.Height = -11
Font.Name = 'Tahoma'
Font.Style = []
OldCreateOrder = True
PixelsPerInch = 96
TextHeight = 13
end
Why is this happened and how should I do it for avoiding these problems?
object MyFrame: TMyFrame
in your DFM toinherited MyFrame: TMyFrame
? – Günther the Beautifulobject MyFrame: TMyFrame
withinherited MyFrame: TMyFrame
I get an errorError creating form: Ancestor for 'TCustomFrame' not found.
on opening the source file using the IDE. – Fabrizio