Solved

"Flat" TStatusPanel's

Posted on 2002-05-22
9
412 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
Find Ransomware Secrets With All-Source Analysis

Ransomware has become a major concern for organizations; its prevalence has grown due to past successes achieved by threat actors. While each ransomware variant is different, we’ve seen some common tactics and trends used among the authors of the malware.

 
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

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

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…
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…
Here's a very brief overview of the methods PRTG Network Monitor (https://www.paessler.com/prtg) offers for monitoring bandwidth, to help you decide which methods you´d like to investigate in more detail.  The methods are covered in more detail in o…
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

746 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

10 Experts available now in Live!

Get 1:1 Help Now