Einzelnen Beitrag anzeigen

SebE

Registriert seit: 31. Jul 2004
Ort: Chemnitz
316 Beiträge
 
Delphi 7 Personal
 
#1

Meine erste Komponente - FEHLER

  Alt 26. Sep 2004, 18:41
Hi.
Ich versuche mich an meiner ersten Komponente.
Ich weis nicht wo der Fehler ist, aber die Komponente lässt sich nich auf ein Formular ziehen .

Code:
unit HoverLabel;

interface

uses
  Classes, Graphics, Controls, StdCtrls,
  Windows, Messages, SysUtils, Variants, Forms,
  Dialogs;

type
  THoverLabel=Class(TLabel)
  private
    { Private-Deklarationen }
    HLHoverColor: TColor;
    HLHoverStyles: TFontStyles;
    HLHoverCaption: TCaption;
    HLHoverCursor: TCursor;

    HLLeaveColor: TColor;
    HLLeaveStyles: TFontStyles;
    HLLeaveCaption: TCaption;
    HLLeaveCursor: TCursor;
  public
    { Public-Deklarationen }
    constructor Create(AOwner: TComponent); override;
    destructor Destroy; override;
  protected
    { Protected-Deklarationen }
    procedure MouseEnter(var Message: TMessage); message CM_MOUSEENTER;
    procedure MouseLeave(var Message: TMessage); message CM_MOUSELEAVE;
  published
    property HoverColor: TColor read HLHoverColor write HLHoverColor;
    property HoverStyles: TFontStyles read HLHoverStyles write HLHoverStyles;
    property HoverCaption: TCaption read HLHoverCaption write HLHoverCaption;
    property HoverCursor: TCursor read HLHoverCursor write HLHoverCursor;

    property LeaveColor: TColor read HLLeaveColor write HLLeaveColor;
    property LeaveStyles: TFontStyles read HLLeaveStyles write HLLeaveStyles;
    property LeaveCaption: TCaption read HLLeaveCaption write HLLeaveCaption;
    property LeaveCursor: TCursor read HLLeaveCursor write HLLeaveCursor;
end;

procedure Register;

implementation

procedure Register;
begin
RegisterComponents('HoverLabel',[THoverLabel]);
end;

constructor THoverLabel.Create;
begin
inherited Create
end;

procedure THoverLabel.MouseEnter;
begin
Cursor:=HLHoverCursor;
Font.Color:=HLHoverColor;
Font.Style:=HLHoverStyles;
Caption:=HLHoverCaption
end;

procedure THoverLabel.MouseLeave;
begin
Cursor:=HLLeaveCursor;
Font.Color:=HLLeaveColor;
Font.Style:=HLLeaveStyles;
Caption:=HLLeaveCaption
end;

destructor THoverLabel.Destroy;
begin
inherited destroy
end;

end.
Ich hoffe ihr könnt mir helfen - Danke
Sebastian
  Mit Zitat antworten Zitat