Einzelnen Beitrag anzeigen

Chris211183

Registriert seit: 19. Sep 2013
Ort: Braunschweig
204 Beiträge
 
Delphi 6 Professional
 
#12

AW: Komponentenentwicklung LED über TShape ?

  Alt 24. Sep 2013, 10:43
Hallo @all,

da bin ich wieder, soweit klappt das wohl jetzt halbwegs, noch ein paar Fragen haben sich jetzt aufgetan:

Die Komponente soll die Eigenschaften aus = grau, Activ = Grün und Inactiv = Rot haben

wie kann man das hier implementieren, habe bis jetzt folgenden Code:


unit Unit1;
interface

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

type
TLED = class(TForm)
HoyLed: TShape;

private
FActive: Boolean;
procedure SetActive(const Value: Boolean);

public

published
property Active: Boolean read FActive write SetActive;
end;

var
LED: TLED;
Shape : TShape;
Brush: TShape;
Color: TColor;
ShowHint: Boolean;

implementation

{$R *.dfm}
procedure TLED.SetActive(const Value: Boolean);
begin
if Active <> FActive then
begin
FActive := Active;
invalidate;
end;

begin
Shape := TShape.Create(LED);

with Shape do
begin
Left := 30;
Top := 30;
Width := 30;
Color := clGreen;
end;
end;
end;
end.

Bin über jede Hilfe dankbar !
Christian
  Mit Zitat antworten Zitat