Solved

Text on statusbar

Posted on 2001-07-27
1
237 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
[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 22

Accepted Solution

by:
Mohammed Nasman earned 100 total points
ID: 6327320
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

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

Suggested Solutions

In this tutorial I will show you how to use the Windows Speech API in Delphi. I will only cover basic functions such as text to speech and controlling the speed of the speech. SAPI Installation First you need to install the SAPI type library, th…
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…
Exchange organizations may use the Journaling Agent of the Transport Service to archive messages going through Exchange. However, if the Transport Service is integrated with some email content management application (such as an antispam), the admini…

732 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