usuário(s) online!

LER ARTIGO
  Artigos Recentes
Todos os Artigos
Mais Votados
Artigos com Arquivos
Por Categoria

  Dicas Recentes
Todas as Dicas
Mais Votadas
Dicas com Arquivos
Por Categoria

  Downloads
Fórum Delphi
E-Zines Anteriores
Notícias
Manifesto Tecnocolor
Nossa Lojinha
Como usar o Site?


  Cadastre-se
Alterar Cadastro
Login/Logout
Escrever Artigos
Escrever Dicas
Meus Artigos
Minhas Dicas


  Contate-nos
Você tem Site?
Indique para Amigos

Colunar Memo
Colunar Memo
Delphi 5.x Delphi 6.x Delphi 7.x
Categoria:
Outros
Nível de Habilidade:
Classificação:
Inserção:
03/03/2009
Palavras Principais:
Colunar Memo Tabular
Número de Votos :
0
Usuário: Ivan Rayol
Referência: Encontrado na Internet

Questão/Problema:

Colunar Memo

Resposta:

Encontrado na Internet


Uses StrUtils

Num formulário coloque um memo e um button


function justr(s : string; tamanho : integer) : string;
var i : integer;
begin
i := tamanho-length(s);
if i>0 then
s := DupeString(' ', i)+s;
justr := s;
end;

function justl(s : string; tamanho : integer) : string;
var i : integer;
begin
i := tamanho-length(s);
if i>0 then
s := s+DupeString(' ', i);
justl := s;
end;

procedure TForm1.Button1Click(Sender: TObject);
var s : String;
v : Real;
begin
with memo1 do
begin
Font.Name := 'Courier New';
Clear;
s := 'teste';
v := 1.34;
Lines.Add(justl(s, 10) + justr(floattostr(v), 12));
s := 'teste2';
v := 35.41;
Lines.Add(justl(s, 10) + justr(floattostr(v), 12));
end;
end;


AVALIE ESTE ARTIGO !
Sua Avaliação:
Ruim
Excelente

 0 COMENTÁRIO(S) PARA ESTE ARTIGO