• 0
Sign in to follow this  
Jhonas

Escrever valores da Direita para Esquerda em um Edit

Question

procedure TForm1.Edit1Enter(Sender: TObject);
begin
  Edit1.Clear;
  SysLocale.MiddleEast := true;
  Edit1.BiDiMode := bdRightToLeft;
end;

procedure TForm1.Edit1KeyPress(Sender: TObject; var Key: Char);
begin
   if pos('R$',Edit1.Text) > 0 then
       Edit1.Clear;

    if key = #13 then
       begin
          Edit1.text := 'R$ ' + formatfloat(',0.00',strtofloat(trim(Edit1.text)));
          exit;
       end;

    if not (key in ['0'..'9',',', #8]) then
       key := #0;
end;

Jhonas .... abraços

Share this post


Link to post
Share on other sites

0 answers to this question

Recommended Posts

There have been no answers to this question yet

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.

Sign in to follow this