Solved

Text on statusbar

Posted on 2001-07-27
1
235 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:
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

Gigs: Get Your Project Delivered by an Expert

Select from freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely and get projects done right.

Question has a verified solution.

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

Suggested Solutions

A lot of questions regard threads in Delphi.   One of the more specific questions is how to show progress of the thread.   Updating a progressbar from inside a thread is a mistake. A solution to this would be to send a synchronized message to the…
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…
This video shows how to quickly and easily add an email signature for all users on Exchange 2016. The resulting signature is applied on a server level by Exchange Online. The email signature template has been downloaded from: www.mail-signatures…
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …

786 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