Solved

Text on statusbar

Posted on 2001-07-27
1
233 Views
Last Modified: 2010-04-06
Hi.
I want to write, in a panel on the statusbar, two words. One in red, the other in blue.

StatusBar1.Panel[0].Text := 'HelloWorld' ;
"Hello" will be in red, and "World" will be in blue.

How can I do that ?

Thanks
0
Comment
Question by:syloux
1 Comment
 
LVL 22

Accepted Solution

by:
mnasman earned 100 total points
Comment Utility
Hello

Add statusbar on the form, and double click on the statusbar to add panel, in the first panel, set it's property sytle to psOwnerDraw, then write this code in the ondrawpanel event

procedure  TForm1.StatusBar1DrawPanel(StatusBar: TStatusBar;
   Panel: TStatusPanel;  const  Rect: TRect);
  begin
  with  StatusBar1.Canvas  do
     begin
      Font.Color := clRed;
      TextOut(Rect.left, Rect.top + 2, 'Hello' );
      Font.Color := clBlue;
      TextOut(Rect.left+30, Rect.top + 2, 'World' );
     end ;
  end ;


Best regards
Mohammed Nasman
0

Featured Post

Do You Know the 4 Main Threat Actor Types?

Do you know the main threat actor types? Most attackers fall into one of four categories, each with their own favored tactics, techniques, and procedures.

Join & Write a Comment

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…
In my programming career I have only very rarely run into situations where operator overloading would be of any use in my work.  Normally those situations involved math with either overly large numbers (hundreds of thousands of digits or accuracy re…
Illustrator's Shape Builder tool will let you combine shapes visually and interactively. This video shows the Mac version, but the tool works the same way in Windows. To follow along with this video, you can draw your own shapes or download the file…
This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.

763 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

13 Experts available now in Live!

Get 1:1 Help Now