Arsip: Membuat EditBox yang RataKanan


by delphy in Articles more 15 years ago 1253
Ingin membuat editbox yang bisa ratakanan? fungsi merupakan komponen editbox yang ratakanan. Komponen ini diturunkan dari TCustomEdit
unit EditBoxRataKanan;
interface
uses Messages, Windows, SysUtils, Classes,
Controls, Forms, Menus, Graphics;
type
TRataKananEdit = class( TCustomEdit)
private
FAlignment : TAlignment;
protected
procedure CreateParams(var Params : TCreateParams); override;
published
property Alignment : TAlignment read FAlignment
write FAlignment;
end;
procedure Register;
implementation
{ TRataKananEdit }
procedure TRataKananEdit.CreateParams(var Params: TCreateParams);
const
Alignments : array[TAlignment] of Integer =
(ES_LEFT, ES_RIGHT, ES_CENTER);
begin
inherited CreateParams(Params);
with Params do
Style := Style AND (NOT 0) OR (ES_MULTILINE)
OR (Alignments[FAlignment]);
end;
procedure Register;
begin
RegisterComponents('DelphiID', [ TRataKananEdit]);
end;
end.
Local Business Directory, Search Engine Submission & SEO Tools FreeWebSubmission.com SonicRun.com