最新消息:Welcome to the puzzle paradise for programmers! Here, a well-designed puzzle awaits you. From code logic puzzles to algorithmic challenges, each level is closely centered on the programmer's expertise and skills. Whether you're a novice programmer or an experienced tech guru, you'll find your own challenges on this site. In the process of solving puzzles, you can not only exercise your thinking skills, but also deepen your understanding and application of programming knowledge. Come to start this puzzle journey full of wisdom and challenges, with many programmers to compete with each other and show your programming wisdom! Translated with DeepL.com (free version)

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

matteradmin7PV0评论

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.
Post a comment

comment list (0)

  1. No comments so far