多动手哦!~
1.放个Toolbar
2.定义一个FToolBarBitmap: TBitmap;
....................
procedure TForm1.tlb1CustomDraw(Sender: TToolBar;
const ARect: TRect;
var DefaultDraw: Boolean);
begin
if Assigned(FToolBarBitmap) then
BitBlt(Sender.Canvas.Handle, 0, 0, Sender.Width,
Sender.Height,FToolBarBitmap.Canvas.Handle,0, 0, SRCCOPY);
end;
procedure TForm1.FormCreate(Sender: TObject);
begin
FToolBarBitmap:= TBitmap.Create;
try
FToolBarBitmap.LoadFromFile('C:/bmp.bmp');
except
FreeAndNil(FToolBarBitmap);
end;
end;
procedure TForm1.FormDestroy(Sender: TObject);
begin
if Assigned(FToolBarBitmap) then
FToolBarBitmap.Free;
end;