admin管理员组文章数量:1026989
I want to create a custom component based on IntraWeb. I tried to create a simple component as coded below. It seems OK at design-time, but at run-time it does not appear on my page. What is the correct way to create a custom component for an IntraWeb application?
unit IWTestPK;
interface
uses
System.SysUtils, System.Classes, Vcl.Controls, IWVCLBaseControl,
IWBaseControl, IWBaseHTMLControl, IWControl, IWCompExtCtrls, VCL.Graphics;
type
TIWTest = class(TIWImage)
private
{ Private declarations }
SS:TStream;
protected
{ Protected declarations }
Procedure Paint; override;
Constructor create(AoWner: Tcomponent); Override;
public
{ Public declarations }
published
{ Published declarations }
end;
procedure Register;
implementation
procedure Register;
begin
RegisterComponents('Samples', [TIWTest]);
end;
Constructor TIWTest.Create(AoWner: Tcomponent);
Begin
Inherited Create(AoWner);
SS:=TStream.Create;
End;
Procedure TIWTest.paint;
Begin
Inherited Paint;
Canvas.Pen.Color:=clRed;
Canvas.Ellipse(1,1,Width,Height);
End;
end.
I want to create a custom component based on IntraWeb. I tried to create a simple component as coded below. It seems OK at design-time, but at run-time it does not appear on my page. What is the correct way to create a custom component for an IntraWeb application?
unit IWTestPK;
interface
uses
System.SysUtils, System.Classes, Vcl.Controls, IWVCLBaseControl,
IWBaseControl, IWBaseHTMLControl, IWControl, IWCompExtCtrls, VCL.Graphics;
type
TIWTest = class(TIWImage)
private
{ Private declarations }
SS:TStream;
protected
{ Protected declarations }
Procedure Paint; override;
Constructor create(AoWner: Tcomponent); Override;
public
{ Public declarations }
published
{ Published declarations }
end;
procedure Register;
implementation
procedure Register;
begin
RegisterComponents('Samples', [TIWTest]);
end;
Constructor TIWTest.Create(AoWner: Tcomponent);
Begin
Inherited Create(AoWner);
SS:=TStream.Create;
End;
Procedure TIWTest.paint;
Begin
Inherited Paint;
Canvas.Pen.Color:=clRed;
Canvas.Ellipse(1,1,Width,Height);
End;
end.
本文标签: delphiHow to create a custom component for an IntraWeb applicationStack Overflow
版权声明:本文标题:delphi - How to create a custom component for an IntraWeb application? - Stack Overflow 内容由热心网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://it.en369.cn/questions/1745662144a2161956.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论