Solved

Statusbar and scrollbars

Posted on 2000-02-21
16
422 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
 
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
Highfive Gives IT Their Time Back

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

 
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

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.

Join & Write a Comment

Suggested Solutions

Have you ever had your Delphi form/application just hanging while waiting for data to load? This is the article to read if you want to learn some things about adding threads for data loading in the background. First, I'll setup a general applica…
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 discusses moving either the default database or any database to a new volume.
You have products, that come in variants and want to set different prices for them? Watch this micro tutorial that describes how to configure prices for Magento super attributes. Assigning simple products to configurable: We assigned simple products…

747 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