Solved

TToolbar with a background image

Posted on 1998-09-25
1
357 Views
Last Modified: 2010-04-06
I would like to have the TToolBar component have a background image like in IE3. I know that this is done by placing a Coolbar on your form and then placing a Toolbar on top of it, setting the Flat property to true.

However, I do not want to use the TCoolbar componet, I would just like to have a TToolbar which has the background image itself. I have tried writing a component based upon the TToolbar but have had no joy in getting the Bitmap to draw on it.

Could someone help me out here? Isn't it just a case of having a Bitmap property on the TToolbar component and then showing that bitmap if the designer loads one?
0
Comment
Question by:jsweby
1 Comment
 
LVL 20

Accepted Solution

by:
Madshi earned 100 total points
Comment Utility
Yes, basically it's that easy.

  TJswebysGreatToolbar = class(TToolBar)
  private
    procedure WMEraseBkgnd(var Message: TWMEraseBkgnd); message WM_ERASEBKGND;
  end;

procedure TJswebysGreatToolbar.WMEraseBkgnd(var Message: TWMEraseBkgnd);
var canvas : TCanvas;
begin
  canvas:=TCanvas.Create;
  try
    canvas.handle:=Message.dc;
    try
      // here do the painting on "canvas"...
    finally canvas.handle:=0 end;
  finally canvas.Free end;
end;

Regards, Madshi.
0

Featured Post

Better Security Awareness With Threat Intelligence

See how one of the leading financial services organizations uses Recorded Future as part of a holistic threat intelligence program to promote security awareness and proactively and efficiently identify threats.

Join & Write a Comment

Introduction I have seen many questions in this Delphi topic area where queries in threads are needed or suggested. I know bumped into a similar need. This article will address some of the concepts when dealing with a multithreaded delphi database…
Introduction Raise your hands if you were as upset with FireMonkey as I was when I discovered that there was no TListview.  I use TListView in almost all of my applications I've written, and I was not going to compromise by resorting to TStringGrid…
This video discusses moving either the default database or any database to a new volume.
In this tutorial you'll learn about bandwidth monitoring with flows and packet sniffing with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're interested in additional methods for monitoring bandwidt…

772 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now