![]() |
Meine erste Komponente - FEHLER
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 :cry: .
Code:
Ich hoffe ihr könnt mir helfen - Danke
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. |
Re: Meine erste Komponente - FEHLER
Hab jetzt nicht soo genau geguckt, aber das würde ich ändern:
Delphi-Quellcode:
constructor THoverLabel.Create(AOwner: TComponent); // Muss auch oben geändert werden
begin inherited Create (AOwner); end; |
Re: Meine erste Komponente - FEHLER
Würdest du bitte deinem Topic ein aussagekräftigen Betreff geben?
|
Alle Zeitangaben in WEZ +1. Es ist jetzt 22:03 Uhr. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024-2025 by Thomas Breitkreuz