Solved

TToolbar with a background image

Posted on 1998-09-25
1
365 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
1 Comment
 
LVL 20

Accepted Solution

by:
Madshi earned 100 total points
ID: 1340857
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

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

The uses clause is one of those things that just tends to grow and grow. Most of the time this is in the main form, as it's from this form that all others are called. If you have a big application (including many forms), the uses clause in the in…
This article explains how to create forms/units independent of other forms/units object names in a delphi project. Have you ever created a form for user input in a Delphi project and then had the need to have that same form in a other Delphi proj…
Monitoring a network: why having a policy is the best policy? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the enormous benefits of having a policy-based approach when monitoring medium and large networks. Software utilized in this v…
Monitoring a network: why having a policy is the best policy? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the enormous benefits of having a policy-based approach when monitoring medium and large networks. Software utilized in this v…

728 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