[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

Scroll Bar does not appear when  Form resizes

Posted on 2006-04-30
7
Medium Priority
?
389 Views
Last Modified: 2012-05-05

  Hi,

  I am using Delphi 5. I have an MDI application. In child forms I have a Panel (align=alTop), a grid (align=alclient) and another panel (align=albottom).Buttons , editboxes etc. are on those top and bottom panels. Child forms have (borderstyle=bssizeable) .

 Problem:
  When the child forms  are resized, the horizontal scroll bar of the form do not appear even if the form is resized to a smaller width than its original.

 I think this happens because the panels have align properties. They also get smaller with form, so horizontal scroll bar does not appear.

 What can be  a solution to this problem? I want to resize the form but the horizonal scroll bar must be seen when necessary..

Thanks.
0
Comment
Question by:caglar_okat
  • 3
  • 3
7 Comments
 
LVL 5

Expert Comment

by:Scay7
ID: 16572006
In the onformcreate did you try making it visible := true;
0
 

Author Comment

by:caglar_okat
ID: 16573406

 Unfortunately this doesn't help. The problem is, form doesn't show the horizontal scroll bar because the albottom and altop panels gets smaller when form gets smaller.
0
 
LVL 34

Accepted Solution

by:
Slick812 earned 1500 total points
ID: 16574383
??? not so sure about what ot why you are asking this?, the auto-scrollBars of a form only are used when componenets are OFF the client area. If you have your panels Aligned to top and bottom, then they are resized with the form, and are still with in the client area. . . So you seem not to want to set your panels NOT to be aligned, if you want them to NOT change size with the form, then do NOT align them with the form, I guess you want them to be at the top and bottom, but not to be changed in width? ? If so you may need to do that yourself.
0
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 34

Expert Comment

by:Slick812
ID: 16574425
I just remembered, , The Anchors  property, may be better for this, you can set the Anchors to  akTop  or  akBottom and Align to alNone, and this may do what you need?
0
 

Author Comment

by:caglar_okat
ID: 16575411
Yes, I want the two panels to be at the top and bottom.

I tried doing it with anchors. I set the appropriate anchors values for the two panels and the grid. When using anchors the horz. scrollbar appears (since the panels do not change widths as form gets smaller.)

But there are some  problems with anchors property,
 when I make the form very smaller (the grid is not seen) , the top and bottom panels overlap.(if I use align they do not overlap).
 when the form is too small as the grid can not be seen, if I scroll the form's scrollbar to the right, the grid loses its original distance to the bottom edge (when I make the grid bigger), and gets behind the bottom panel.The grid behaves like it is anchored to the bottom edge (as if there is no bottom panel).

0
 
LVL 34

Assisted Solution

by:Slick812
Slick812 earned 1500 total points
ID: 16581337
OK, I really do Not understand any  about the "Grid", and it's positions, , but here is a way to have the Bottom panel do exactly as you want it to, you can position it to anywhere you want in the Parent's (a TForm in this cace) OnResize event, , the Panel1 is the TOP Panel, and Panel2 is the BOTTOM Panel , , ,both of these TPanels have the Default settings, Align= alNone, Anchors= [akLeft, akTop] -


procedure TForm2.FormResize(Sender: TObject);
begin
if ClientHeight > Panel1.Height + Panel2.Height {+Grid1.Height} then // test for the minimum you will need here
  Panel2.Top := ClientHeight - Panel2.Height // move the Panel2 to the position you may require, I place at bottom
  else // if less than minimum, then place at bottom of Panel1
  Panel2.Top := Panel1.Height {+Grid1.Height}; // add any amount for more separation
end;


 = = = = = = = = = =  = =
you can test for the minimum with whatever amount you need to preserve (IE, something to do with the grid) and then place the Panel2 where you need it, , ,you can also move the grid to the position for best visiblility
0
 

Author Comment

by:caglar_okat
ID: 16594250

 Thanks for the answers. I was wondering if there is an easy method for solving this problem other than writing code in some events.
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Objective: - This article will help user in how to convert their numeric value become words. How to use 1. You can copy this code in your Unit as function 2. than you can perform your function by type this code The Code   (CODE) The Im…
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…
Please read the paragraph below before following the instructions in the video — there are important caveats in the paragraph that I did not mention in the video. If your PaperPort 12 or PaperPort 14 is failing to start, or crashing, or hanging, …
In a question here at Experts Exchange (https://www.experts-exchange.com/questions/29062564/Adobe-acrobat-reader-DC.html), a member asked how to create a signature in Adobe Acrobat Reader DC (the free Reader product, not the paid, full Acrobat produ…
Suggested Courses

872 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