?
Solved

How can I format the text of the StatusBar?

Posted on 2002-03-19
16
Medium Priority
?
340 Views
Last Modified: 2010-08-05
Hi all,
How can I format the text of the StatusBar?
e.g. Change the text of StatusBar.Panels[1]  to  "Red" and "Bold"?
(Just change the StatusBar.Panels[1], don't change other Panels)

Thanks, Bin
0
Comment
Question by:xbbin
[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
  • 7
  • 4
  • 2
  • +2
16 Comments
 
LVL 9

Accepted Solution

by:
ginsonic earned 120 total points
ID: 6879623
Read these :

How to draw coloured text on a TStatusBar
http://www.lmc-mediaagentur.de/dpool/tips01/0034.htm

How to write bold text on a TStatusBar
http://www.lmc-mediaagentur.de/dpool/tips02/0164.htm
0
 

Author Comment

by:xbbin
ID: 6879880
Hi ginsonic,
How can I just format the text of StatusBar.Panels[1], don't format StatusBar.Panels[0] and StatusBar.Panels[2]?
0
 
LVL 2

Expert Comment

by:Drareg
ID: 6879950
Procedure  TForm1.StatusBar1DrawPanel(StatusBar: TStatusBar;
  Panel: TStatusPanel;  Const  Rect: TRect);
Begin
  If Panel = StatusBar1.Panels[0] Then
      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 ;

  If Panel = StatusBar1.Panels[2] Then
      With StatusBar1.Canvas Do
          Begin
              Font.Color := clYellow ;
              TextOut(Rect.Left + 12, Rect.Top + 2, 'Patatouf') ;
          End ;
End ;
0
What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

 

Expert Comment

by:DelFreak
ID: 6879995
Listening...
0
 
LVL 9

Expert Comment

by:ginsonic
ID: 6880322
Have you read my tips ? All what you need are there
.
procedure TForm1.StatusBar1DrawPanel(StatusBar: TStatusBar;
Panel: TStatusPanel; const Rect: TRect);
begin

  if Panel = StatusBar.Panels[1] then
  begin
    StatusBar.Canvas.Font.Color := clRed;
    StatusBar.Canvas.TextOut(Rect.Left, Rect.Top, MyText' )
   end;

end;
0
 
LVL 9

Expert Comment

by:ginsonic
ID: 6880326
In tip sample is used Panel[0] but you can choice your own panel . Just use
 if Panel = StatusBar.Panels[YourPanel] then ...
0
 
LVL 9

Expert Comment

by:ginsonic
ID: 6880341
DelFreak have you receive my mail ?
How work the project into your system ?

Regards,
Nick
0
 

Author Comment

by:xbbin
ID: 6881534
Hi ginsonic,
How can I change the text color at runtime?
0
 
LVL 6

Expert Comment

by:Stuart_Johnson
ID: 6881675
LOL!  Didn't you read Ginsonic's post three posts back?  That's exactly the way you do it.
0
 

Author Comment

by:xbbin
ID: 6881686
Yes, I means How can I click a button to change the color to clRed, click another button change to clBlack.
0
 
LVL 6

Expert Comment

by:Stuart_Johnson
ID: 6881724
var
  StatFontColor: TColor;

procedure TForm1.Button1Click(Sender: TObject);
begin
  if StatFontColor = clBlack then
    StatFontColor := clRed
  else
    StatFontColor := clBlack;

  StatusBar1.Invalidate;
end;

procedure TForm1.StatusBar1DrawPanel(StatusBar: TStatusBar;
Panel: TStatusPanel; const Rect: TRect);
begin

 if Panel = StatusBar.Panels[1] then
 begin
   StatusBar.Canvas.Font.Color := StatFontColor;
   StatusBar.Canvas.TextOut(Rect.Left, Rect.Top, MyText' )
  end;

end;
0
 
LVL 9

Expert Comment

by:ginsonic
ID: 6881742
Was very simple :)
0
 

Author Comment

by:xbbin
ID: 6882120
Sorry, I just a delphi beginner.

Hi Drareg,
Here have some points for you: http://www.experts-exchange.com/jsp/qManageQuestion.jsp?ta=delphi&qid=20279202

Hi Stuart Johnson,
Here have some points for you: http://www.experts-
exchange.com/jsp/qManageQuestion.jsp?ta=delphi&qid=20279198

Thanks, Bin
0
 
LVL 9

Expert Comment

by:ginsonic
ID: 6882266
Look like you are an Ex-Ex beginner user, too :)
Any time with pleasure. Just ask .

Regards,
Nick aka ginsonic
0
 

Expert Comment

by:DelFreak
ID: 6883165
Hey Nick! Yeah I got it. Thanks man! Works okay. I just love socket related stuff. Hehehe!


Cheers,
DelFreak
0
 
LVL 9

Expert Comment

by:ginsonic
ID: 6884766
Glad to hear that.
See you on net .
0

Featured Post

Technology Partners: 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

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…
Introduction I have seen many questions in this Delphi topic area where queries in threads are needed or suggested. I know bumped into a similar need. This article will address some of the concepts when dealing with a multithreaded delphi database…
Michael from AdRem Software outlines event notifications and Automatic Corrective Actions in network monitoring. Automatic Corrective Actions are scripts, which can automatically run upon discovery of a certain undesirable condition in your network.…
This tutorial will teach you the special effect of super speed similar to the fictional character Wally West aka "The Flash" After Shake : http://www.videocopilot.net/presets/after_shake/ All lightning effects with instructions : http://www.mediaf…
Suggested Courses

762 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