Solved

Statusbar and scrollbars

Posted on 2000-02-21
16
426 Views
Last Modified: 2012-05-04
I am having trouble with the status bar.

When I load something into my form that brings about the scrollbars, the status bar is moved to the bottom of the scroll.  I want to have the status bar always on top with the scrollbars still enabled.

0
Comment
Question by:fibdev
  • 6
  • 5
  • 4
  • +1
16 Comments
 
LVL 8

Accepted Solution

by:
ZifNab earned 50 total points
ID: 2544206
Set Align property to alTop.

If this still doesn't help you... then drop a panel, set it's align property to alTop and drop the statusbar on the panel.

Zif.
0
 
LVL 17

Expert Comment

by:inthe
ID: 2544247
agree ..(the panel trick will do it for sure).
0
 
LVL 17

Expert Comment

by:inthe
ID: 2544251
but wont the panel be alBottom?
0
Free Tool: Postgres Monitoring System

A PHP and Perl based system to collect and display usage statistics from PostgreSQL databases.

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.

 
LVL 3

Author Comment

by:fibdev
ID: 2544276
I tryed the panel idea and it still isn't working.  As soon as the scrollbar appears, the panel and statusbar are gone (till I scroll down of course).
0
 
LVL 8

Expert Comment

by:ZifNab
ID: 2544281
mmm, can you show us how your form looks like?
0
 
LVL 3

Author Comment

by:fibdev
ID: 2544358
This form gives you the idea of what happens when I load an image into the image box at run time.

http://fibdev.com/bin/mydelphi.zip
0
 
LVL 8

Expert Comment

by:ZifNab
ID: 2545568
mmm, I get a streaming error when loading your form.
0
 
LVL 3

Author Comment

by:fibdev
ID: 2545752
It's a delphi 5 project.  Don't know if that's why, but it loads fine here.
0
 
LVL 17

Expert Comment

by:inthe
ID: 2547582
i also use d4 ( yes this is stream error reason :-(


0
 
LVL 17

Expert Comment

by:inthe
ID: 2547603
you could post the code of your unit here and right click on your form and choose "view as text" and also paste that here ,then us underpriviledged ;-) d4 users can build you project to test

0
 
LVL 8

Expert Comment

by:ZifNab
ID: 2547688
fibdev,

here is what you can do :

1.

* Set Image.Align property to alClient

But then you loose the scrollbars arond the image when the form gets smaller.

This is a better way :

2.

* Put a TScrollBox on the form and set its align property to alClient.
* Drop the TImage inside the TScrollBox

Thus your form should look like :

a TStatusBar at bottom (no panel)
a TScrollBox as alClient (thus filling rest of form)
a TImage inside the TScrollBox

And then you get the behavior you want.

Regards, Zif.
0
 

Expert Comment

by:mountykit
ID: 2550770
listening
0
 
LVL 3

Author Comment

by:fibdev
ID: 2552563
Hey Zif,

I tryed it, still having the problem :\
0
 
LVL 8

Expert Comment

by:ZifNab
ID: 2553746
????

Please send me your e-mail-address and I'll send you the code.

Zif.
0
 
LVL 8

Expert Comment

by:ZifNab
ID: 2555249
object Form1: TForm1
  Left = 192
  Top = 107
  Width = 696
  Height = 480
  Caption = 'Form1'
  Color = clBtnFace
  Font.Charset = DEFAULT_CHARSET
  Font.Color = clWindowText
  Font.Height = -11
  Font.Name = 'MS Sans Serif'
  Font.Style = []
  OldCreateOrder = False
  PixelsPerInch = 96
  TextHeight = 13
  object StatusBar1: TStatusBar
    Left = 0
    Top = 434
    Width = 688
    Height = 19
    Panels = <>
    SimplePanel = False
  end
  object ScrollBox1: TScrollBox
    Left = 0
    Top = 0
    Width = 688
    Height = 434
    Align = alClient
    TabOrder = 1
    object Image1: TImage
      Left = 0
      Top = 0
      Width = 105
      Height = 105
    end
  end
end
0
 
LVL 3

Author Comment

by:fibdev
ID: 2555895
zif,

expert@fibdev.com

Let me post some VB code to demonstrate the way I think this should work.  If someone can get the idea from the code (even if they don't know vb) then maybe they can tell me how it should look in delphi.

vb code sample for resizing the scrolbars to fit.
This is assuming the status bar is 15 pixels tall.
======================================

Sub Form1_Resize()

  ' Resize the vertical scrollbar
  With vScrollbar
    .top = 0
    .height = Form1.height - 30
  End With

  ' Now the horizontal scrollbar
  Dim BottomValue as Integer
 
  BottomValue = Form1.Height - 30 ' 15 for the scrollbar, 15 for the status bar
  With hScrollbar
    .Top = BottomValue
    .Width = Form1.Width - 15
  End With

End Sub

There may be an error or two in this code.  I just wrote it here and haven't really checked it.  So, VB ppl, please excuse me :)  This should give someone the idea of how I think this should work.
0

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

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

A lot of questions regard threads in Delphi.   One of the more specific questions is how to show progress of the thread.   Updating a progressbar from inside a thread is a mistake. A solution to this would be to send a synchronized message to the…
In my programming career I have only very rarely run into situations where operator overloading would be of any use in my work.  Normally those situations involved math with either overly large numbers (hundreds of thousands of digits or accuracy re…
This video shows how to use Hyena, from SystemTools Software, to bulk import 100 user accounts from an external text file. View in 1080p for best video quality.

839 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