Pesquisar neste blogue

quinta-feira, 9 de junho de 2011

Text with border's. No problem!

Hi.
Do you need of put borders in your text. in this article I solve the problem.
1 - Put a TShape in Form.
2 - At the event onPaint of TShape put the code :

  Shape1.Canvas.Font.Color:=clRed;
  Shape1.Canvas.TextOut(1,1,'Teste');
And now have your own Label with border.
With this way you can change the border color.

5 comentários:

  1. Da ultima vaz que usei TStaticText não consegui editar-lhe o texto por código. Experimentei agora e pelos vistos é outra solução para o problema.

    ResponderEliminar
  2. E pelas pesquisas que fiz não é possível alterar-lhe a cor do bordo. No TStaticText é possível.

    ResponderEliminar
  3. Sílvio, por outro lado, TStaticText herda de TWinControl, então no Windows aloca Handle/mais recursos.
    Daniel, você pode desenhar a borda no OnPaint também...

    ResponderEliminar

Obtigado pelo comentário.