首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > .NET > .NET >

请问vcl控件子类化如何弄的

2012-02-22 
请教vcl控件子类化怎么弄的?无hwnd的控件也可以吗?[解决办法]Of course.For Example:Delphi(Pascal) codev

请教vcl控件子类化怎么弄的?
无hwnd的控件也可以吗?

[解决办法]
Of course.

For Example:

Delphi(Pascal) code
var  FOldWndProc: TWndMethod;//New message process methodprocedure TForm1.NewWndProc(var AMsg: TMessage);begin  //You can process message here.  ...end;//Replace Oldprocedure TForm1.Button1Click(Sender: TObject);begin  FOldWndProc:= Label1.WindowProc;  Label1.WindowProc:= NewWndProc;end;//Restore old window message process methodprocedure TForm1.Button2Click(Sender: TObject);begin  Label1.WindowProc:= FOldWndProc;end; 

热点排行