delphi - How to create a custom component for an IntraWeb application? - Stack Overflow

I want to create a custom component based on IntraWeb. I tried to create a simple component as coded be

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.

发布者:admin,转转请注明出处:http://www.yc00.com/questions/1745662145a4638901.html

相关推荐

发表回复

评论列表(0条)

  • 暂无评论

联系我们

400-800-8888

在线咨询: QQ交谈

邮件:admin@example.com

工作时间:周一至周五,9:30-18:30,节假日休息

关注微信