Jump to content
Fórum Script Brasil
  • 0

(Resolvido) Como fazer esse efeito no delphi


Kali

Question

3 answers to this question

Recommended Posts

  • 0

exemplo

unit Unit1;

interface

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

type
  TForm1 = class(TForm)
    Edit1: TEdit;
    procedure FormCreate(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  Form1: TForm1;

implementation

{$R *.dfm}

type
  TAlinEdit = class (TEdit)
  protected
    procedure CreateParams(var Params: TCreateParams); override;
  end;

procedure TAlinEdit.CreateParams(var Params: TCreateParams);
begin
  inherited CreateParams(Params);
  Params.Style := Params.Style or ES_CENTER;
end;

procedure TForm1.FormCreate(Sender: TObject);
begin
  PPointer(Edit1)^ := TAlinEdit;
  TAlinEdit(Edit1).RecreateWnd;
end;

end.

O texto do edit será centralizado no OnFormCreate do formulario, mas voce pode colocar isso em outro evento ( botão, OnExit do edit ...etc )

abraço

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.



  • Forum Statistics

    • Total Topics
      152.1k
    • Total Posts
      652k
×
×
  • Create New...