一
此類轉化有一個常用的也可以說較笨的的方法
(
在開始之前
(
打開MainForm
(
打開ActiveFormX
initialization
TActiveFormFactory
ComServer
TActiveFormControl
TActiveFormX
Class_ActiveFormX
OLEMISC_SIMPLEFRAME or OLEMISC_ACTSLIKELABEL
tmApartment);
把第五行中TActiveFormX改為TfrmMain
(
查看一下delphi源碼
TCustomForm
TCustomForm
TForm的部分published屬性在TActiveForm未被聲明
published
property Action;
property Align;
property AlphaBlend default False;
property AlphaBlendValue default
property BiDiMode;
property BorderIcons;
property BorderStyle;
property ClientHeight;
property ClientWidth;
property TransparentColor default False;
property TransparentColorValue default
property Ctl
property UseDockManager;
property DefaultMonitor;
property DockSite;
property DragKind;
property DragMode;
property Enabled;
property ParentFont default False;
property FormStyle;
property HelpFile;
property Icon;
property Menu;
property ObjectMenuItem;
property ParentBiDiMode;
property Position;
property Visible;
property WindowState;
property WindowMenu;
property OnCanResize;
property OnClose;
property OnCloseQuery;
property OnConstrainedResize;
property OnDockDrop;
property OnDockOver;
property OnEndDock;
property OnGetSiteInfo;
property OnHide;
property OnHelp;
property OnMouseWheel;
property OnMouseWheelDown;
property OnMouseWheelUp;
property OnResize;
property OnShortCut;
property OnShow;
property OnStartDock;
property OnUnDock;
對於上面所列的事件屬性
(
如果你在TfrmMain的OnPaint事件中寫了代碼
inherited Initialize;
OnActivate := ActivateEvent;
OnClick := ClickEvent;
OnCreate := CreateEvent;
OnDblClick := DblClickEvent;
OnDeactivate := DeactivateEvent;
OnDestroy := DestroyEvent;
OnKeyPress := KeyPressEvent;
OnPaint := PaintEvent;
原來問題出在這裡
如
然後在TfrmMain的OnCreat事件中賦給OnPaint就行了
上面列舉的幾個事件都和OnPaint類似
二
(
綜上所述
(
只要你按(
From:http://tw.wingwit.com/Article/program/Delphi/201311/24829.html