Mega Code Archive

 
Categories / Delphi / String
 

Using a control without registring

Title: Using a control without registring Question: Using a control without registring Answer: That will be explained with a simple example: type TEditX = class(TEdit) private function GetForeColor: TColor; procedure SetForeColor(Color: TColor); public property ForeColor: TColor read GetForeColor write SetForeColor; Then Enter below in implementation section: function TEditX.GetForeColor: TColor; begin Result:=Font.Color; end; procedure TEditX.SetForeColor(Color: TColor); begin Font.Color:=Color; end; For accessing to New property use this way: TEditX(TEdit).ForeColor := clRed;