caglar_okat
asked on
Scroll Bar does not appear when Form resizes
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.
In the onformcreate did you try making it visible := true;
ASKER
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.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
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?
ASKER
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).
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).
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Thanks for the answers. I was wondering if there is an easy method for solving this problem other than writing code in some events.