Mega Code Archive

 
Categories / Delphi / VCL
 

Sağa dayalı edit

//Aşağıda Komponentin kodları mevcuttur unit just; interface uses Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs, StdCtrls; type TJustaEdit = class(TEdit) private { Private declarations } fAlignment : TAlignment; protected { Protected declarations } procedure SetAlignment(Value: TAlignment); public { Public declarations } procedure createParams(var Params : TCreateParams); override; published { Published declarations } property Alignment: TAlignment read FAlignment write SetAlignment default taLeftJustify; end; procedure Register; implementation procedure TJustaEdit.CreateParams(var Params : TCreateParams); var x : Longint; begin inherited CreateParams(Params); case fAlignment of tarightjustify: x := es_right; taleftjustify : x := es_left; tacenter : x := es_center; end; params.style := params.style or x; end; procedure TJustaEdit.SetAlignment; begin if FAlignment <> Value then begin FAlignment := Value; RecreateWnd; end; end; procedure Register; begin RegisterComponents('Samples', [TJustaEdit]); end; end.