Solved

"Flat" TStatusPanel's

Posted on 2002-05-22
9
420 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
Master Your Team's Linux and Cloud Stack!

The average business loses $13.5M per year to ineffective training (per 1,000 employees). Keep ahead of the competition and combine in-person quality with online cost and flexibility by training with Linux Academy.

 

Expert Comment

by:shameddragon
ID: 7035185
Is it like this?
StatusBar1.Panels[i].Bevel:=pbNone;
0
 
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

DevOps Toolchain Recommendations

Read this Gartner Research Note and discover how your IT organization can automate and optimize DevOps processes using a toolchain architecture.

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 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…
This tutorial gives a high-level tour of the interface of Marketo (a marketing automation tool to help businesses track and engage prospective customers and drive them to purchase). You will see the main areas including Marketing Activities, Design …
Established in 1997, Technology Architects has become one of the most reputable technology solutions companies in the country. TA have been providing businesses with cost effective state-of-the-art solutions and unparalleled service that is designed…

810 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