Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Text on statusbar

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

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Introduction The parallel port is a very commonly known port, it was widely used to connect a printer to the PC, if you look at the back of your computer, for those who don't have newer computers, there will be a port with 25 pins and a small print…
Creating an auto free TStringList The TStringList is a basic and frequently used object in Delphi. On many occasions, you may want to create a temporary list, process some items in the list and be done with the list. In such cases, you have to…
In this video, Percona Solutions Engineer Barrett Chambers discusses some of the basic syntax differences between MySQL and MongoDB. To learn more check out our webinar on MongoDB administration for MySQL DBA: https://www.percona.com/resources/we…
In a question here at Experts Exchange (https://www.experts-exchange.com/questions/29062564/Adobe-acrobat-reader-DC.html), a member asked how to create a signature in Adobe Acrobat Reader DC (the free Reader product, not the paid, full Acrobat produ…
Suggested Courses

610 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