Fórum Imagem num Statusbar. #302809
22/11/2005
0
Gostava de saber como poxo colocar uma img num componente StatusBar.
Obrigado.
Rui Lisboa
Curtir tópico
+ 0Posts
22/11/2005
Ramms
sinceramente não sei se funciona, dah uma testada awe e responde se conseguiu
flw
Unit Unit1;
interface
uses
Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
ImgList, ComCtrls;
type
TForm1 = class(TForm)
StatusBar1: TStatusBar;
ImageList1: TImageList;
procedure StatusBar1DrawPanel(StatusBar: TStatusBar;
Panel: TStatusPanel; const Rect: TRect);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form1: TForm1;
implementation
{$R *.DFM}
{Adicione um StatusBar e um ImageList, iclua no imagelist as figuras que deseja
mostrar apos mude a propriedade Style dos Panels do StatusBar para psOwnerDraw,
em seguida inclua o codigo abaixo no evento OnDrawPanel do StatusBar}
procedure TForm1.StatusBar1DrawPanel(StatusBar: TStatusBar;
Panel: TStatusPanel; const Rect: TRect);
begin
with StatusBar1.Canvas do
begin
FillRect(Rect);
//Definir Font e Style
Font.Name := ´Arial´;
Font.Color := ClNavy;
Font.Style := [FsBold];
//Desenha as imagens de acordo com o indice de cada panel
ImageList1.Draw(StatusBar1.Canvas,Rect.Left+5,Rect.Top+1,Panel.Index);
//Escreve o texto em cada panel
if Panel.Index = 0 then
TextOut(Rect.Left + 25, Rect.Top + 1,´LloydSoft - Panel1´);
if Panel.Index = 1 then
TextOut(Rect.Left + 25, Rect.Top + 1,´LloydSoft - Panel 1´);
if Panel.Index = 2 then
TextOut(Rect.Left + 25, Rect.Top + 1,´LloydSoft - Panel 2´);
end;
end;
end.Gostei + 0
22/11/2005
Rui Lisboa
Pode me dizer o sait?
Gostei + 0
22/11/2005
Ramms
pode ser acessado por esses 2 links
http://www.delphi.eti.br
http://www.delphiforum.com.br
Gostei + 0
Clique aqui para fazer login e interagir na Comunidade :)