Solved

"Flat" TStatusPanel's

Posted on 2002-05-22
9
416 Views
Last Modified: 2010-04-04
I need the TStatusPanel's on my TStatusBar to have no border / be flat. In other words for the TStatusBar to look the same as when ones uses SimplePanel = True but have a number of TStatusPanel's.

Is this possible?

Thanks, Tom.
0
Comment
Question by:tomcorcoran
9 Comments
 
LVL 14

Expert Comment

by:DragonSlayer
ID: 7028950
for each StatusPanel that you create, set its Bevel property to pbNone
0
 

Author Comment

by:tomcorcoran
ID: 7029491
Nice, I didn't spot that. Now however is looks like there  is no StatusBar, just text appearing. I want it to look like when ones uses SimplePanel = True. TStatusBar does not seem to have any bevel/border properties I coud use. I tried embedding it in a TPanel and I couldn't get that to work...maybe I need to play with that again. Any ideas?

Thanks, Tom.
0
 

Author Comment

by:tomcorcoran
ID: 7029532
Nice, I didn't spot that. Now however is looks like there  is no StatusBar, just text appearing. I want it to look like when ones uses SimplePanel = True. TStatusBar does not seem to have any bevel/border properties I coud use. I tried embedding it in a TPanel and I couldn't get that to work...maybe I need to play with that again. Any ideas?

Thanks, Tom.
0
 

Expert Comment

by:shameddragon
ID: 7035185
Is it like this?
StatusBar1.Panels[i].Bevel:=pbNone;
0
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 
LVL 14

Accepted Solution

by:
DragonSlayer earned 50 total points
ID: 7038148
well tom, if you really want to embed it in a TPanel, create a Panel on the form, set the Align to alBottom, then while the Panel is still selected, double-click on the statusbar component at the component bar, this will embed the statusbar into the panel. Then, resize the panel appropriately. Set the Panel's BevelOuter to bvLowered.
0
 

Author Comment

by:tomcorcoran
ID: 7041285
Thanks, I tried that exactly. It does not work, setting the statuspanel.bevel to pbNone seems to overwrite the panel's bevel. Can't et it to stay on :-(

Cheers, tom.
0
 
LVL 1

Expert Comment

by:DavidLeeding
ID: 7052647
Here's something you might want to try...haven't tested it properly myself but should work: Try creating the TStatusBar at runtime and setting its parent to be your TPanel (assuming you have one on the form). This embeds it in the TPanel rather than just superimposing it:

uses  ..., ComCtrls, ....
...
var
  sb: TStatusBar;
...

implementation

...

procedure TForm1.FormCreate(Sender: TObject);
var
  i: Integer;
begin
  sb := TStatusBar.Create(Application);
  with sb do
  begin
    Parent := MyPanel; // Replace MyPanel with the name
                       // of the TPanel you're using
    SizeGrip := False; // This is optional

    // Create the panels...
    for i := 0 to MAX_STATUSBAR_PANELS do
    begin
      Panels.Add;
      Panels[i].Bevel := pbNone;
      // Panels[i].OtherProperty := ...etc etc etc
    end;

    // By default, the status bar will align to the bottom
    // of the TPanel. If this is unsatisfactory, change
    // the alignment to have it behave differently,
    // eg Align := alNone, Top := 47; Left := 0;
    // Width := 470.....etc

    // Now show it..
    Show;

  end;
end;

procedure TForm1.FormClose(Sender: TObject; var Action: TCloseAction);
begin
  sb.Free;
end;

Then you can write to the status bar as you normally would:

  sb.Panels[0].Text := 'Hello world';
  sb.Panels[3].Text := 'yada yada yada';

Hope this helps! (Hope I've understood the problem correctly!!)

0
 

Author Comment

by:tomcorcoran
ID: 7076892
David,

Thanks for that. However is does not work. The statusbar still appears invisible.

Does anyone know how to get that border showing?

Thansk, Tom.
0
 

Author Comment

by:tomcorcoran
ID: 7870188
Time to wind this one up I guess.
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

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…
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…
When you create an app prototype with Adobe XD, you can insert system screens -- sharing or Control Center, for example -- with just a few clicks. This video shows you how. You can take the full course on Experts Exchange at http://bit.ly/XDcourse.
I designed this idea while studying technology in the classroom.  This is a semester long project.  Students are asked to take photographs on a specific topic which they find meaningful, it can be a place or situation such as travel or homelessness.…

930 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

Need Help in Real-Time?

Connect with top rated Experts

9 Experts available now in Live!

Get 1:1 Help Now