Announcement

Collapse
No announcement yet.

komponenten entwicklung

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • komponenten entwicklung

    Hallo!
    Immer wenn ich eine neue Komponente entwickle und es ausprobiere, steht 'no parent windows' dar wißt ihr vielleicht warum? Oder wißt ihr wie man eine neue Komponente von Tcontrol ableitet?
    Ich wäre für ein antwort dankbar !!!!
    Danke im voraus!!!!!!!!

  • #2
    <p>Hallo,<br>
    <br>
    <pre>
    interface
    </pre>
    <pre>
    uses
    Windows, .....
    type
    TMyCtrl=class(TControl)
    private
    fZahl:Integer;
    fText:String;
    procedure SetZahl(aZahl:Integer);
    public
    constructor Create(aOwner:TComponent);
    published
    property Zahl:Integer read fZahl write SetZahl;
    property Text:String read fText write fText;
    end; // TMyCtrl
    </pre>
    <pre>
    implementation
    </pre>
    <pre>
    constructor TMyCtrl.Create(aOwner:TComponent);
    begin
    inherited Create(aOwner);
    fZahl:=0;
    fText:='Mein 1. Control';
    end; // TMyCtrl.Create
    </pre>
    <pre>
    procedure TMyCtrl.SetZahl(aZahl:Integer);
    begin
    if (aZahl<>fZahl) then
    begin
    fZahl:=aZahl;
    end;
    end; // SetZahl
    </pre>
    <br>
    Hoffe es hilft. Gruß Thomas</p&gt

    Comment


    • #3
      Hinter die deklaration des Constructors muss noch override, sonst greift inheritted in der implementation ins leere, weil der alte constructor nicht mehr sichtbar ist

      Comment

      Working...
      X