?
Solved

Text on statusbar

Posted on 2001-07-27
1
Medium Priority
?
239 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 400 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

On Demand Webinar - Networking for the Cloud Era

This webinar discusses:
-Common barriers companies experience when moving to the cloud
-How SD-WAN changes the way we look at networks
-Best practices customers should employ moving forward with cloud migration
-What happens behind the scenes of SteelConnect’s one-click button

Question has a verified solution.

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

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…
Introduction Raise your hands if you were as upset with FireMonkey as I was when I discovered that there was no TListview.  I use TListView in almost all of my applications I've written, and I was not going to compromise by resorting to TStringGrid…
Have you created a query with information for a calendar? ... and then, abra-cadabra, the calendar is done?! I am going to show you how to make that happen. Visualize your data!  ... really see it To use the code to create a calendar from a q…
How to fix incompatible JVM issue while installing Eclipse While installing Eclipse in windows, got one error like above and unable to proceed with the installation. This video describes how to successfully install Eclipse. How to solve incompa…
Suggested Courses

765 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