Solved

TToolbar with a background image

Posted on 1998-09-25
1
364 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

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

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

Suggested Solutions

Objective: - This article will help user in how to convert their numeric value become words. How to use 1. You can copy this code in your Unit as function 2. than you can perform your function by type this code The Code   (CODE) The Im…
Have you ever had your Delphi form/application just hanging while waiting for data to load? This is the article to read if you want to learn some things about adding threads for data loading in the background. First, I'll setup a general applica…
In an interesting question (https://www.experts-exchange.com/questions/29008360/) here at Experts Exchange, a member asked how to split a single image into multiple images. The primary usage for this is to place many photographs on a flatbed scanner…
Attackers love to prey on accounts that have privileges. Reducing privileged accounts and protecting privileged accounts therefore is paramount. Users, groups, and service accounts need to be protected to help protect the entire Active Directory …

738 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