Recent

Author Topic: Inizialize FCaption on Create Components, Help Me  (Read 3397 times)

laguna

  • Sr. Member
  • ****
  • Posts: 267
Inizialize FCaption on Create Components, Help Me
« on: August 28, 2009, 04:06:18 pm »
   
Implemented the component I SMNetGradient I could not initialize the Caption field with the value assigned to the property name of the component.
Basically I want to create the Caption property is assigned the value "NAME + NUMBER"

Code: [Select]
constructor TNetGradient.Create(AOwner: TComponent);
var s:string;
begin
  { Inherit original constructor }
  inherited Create(AOwner);
  { Add new initializations }
   FLayout        := tlCenter;
  FBevelInner    := bvNone;
  FBevelOuter    := bvRaised;

  Height := 25;
  Width := 400;
  FBeginColor := clSilver;
  FEndColor := $00A56D39;
  //Align := alTop;
  FDirection := fdLeftToRight;
  FNumberOfColors:= 255;
  FTextLeft:= 0;
  FTextTop:= 0;
  FFont:= TFont.Create;
  FFOnt.Style:= [fsbold];
 

 // FCaption:= NAME + NUMBER   <----------------

  //*** Enzo ***
  FDataLink := TFieldDataLink.Create;
  FDataLink.Control := Self;
  FDataLink.OnDataChange := DataChange;
  (*
  FDataLink.OnUpdateData := @UpdateData;
  FDataLink.OnActiveChange := @ActiveChange;
  FDataLink.OnLayoutChange := @LayoutChange;
  *)
end;