procedure TForm1.FormCreate(Sender: TObject);
begin
Image1.Left := 2;
Image1.Top := 1;
Image1.Parent := StatusBar1;
end;
begin
Image1.Left := 2;
Image1.Top := 1;
Image1.Parent := StatusBar1;
end;
Form1: TForm1; Map:TImage;
implementation{$R *.dfm}procedure TForm1.Button1Click(Sender: TObject);begin
Map:=TImage.Create(Self) ;
Map.Picture.LoadFromFile('c:\a.bmp');
map.Left :=0;
map.top :=10;
map.Width :=30;
map.Height :=30;
Map.parent:=StatusBar1;
end;
procedure TForm1.Button2Click(Sender: TObject);
begin
map.free;
end;end.
begin
ImageList1.Draw(StatusBar1.Canvas,1,1,0);
end;
如StatusBar1.Panels[1].style:=psOwnerDraw; 3、定义一个StatusDrawRect:TRect;的全局变量4、在StatusBar1的ondrawpanel事件加入
StatusDrawRect:=rect;5、在button1的click事件加入
with image1 do
begin
top:=StatusDrawRect.top;
left:=StatusDrawRect.left;
width:=StatusDrawRect.bottom-StatusDrawRect.top;
height:=StatusDrawRect.bottom-StatusDrawRect.top;
visible:=true;
Parent := StatusBar1;
end;
不清楚,我这有DEMO