Board index » delphi » Align := alTop

Align := alTop

Hello,

Strange little problem:

On my form, I've got a client-aligned Panel1. Within this panel I've got a
top-aligned Panel2, about the size of a toolbar. Now, at runtime I'd like to
create a variable number of TPanels, all children of Panel1, and also all
top-aligned. My understanding is that as I create these panels, they should
appear below Panel2, that is Panel3 is below Panel2, Panel4 is below Panel3,
etc. However, what happens is that all my dynamically-created panels appear
above Panel2. Why is this different from design-time when all
subsequently-created panels appear below each other. Thanks again,

Sean.

 

Re:Align := alTop


In the last sentence, I meant:

"Why is this different from design-time when all subsequently-created panels
appear below Panel2"

Thanks,

Sean

Re:Align := alTop


I'm not sure I understand the question, but, if you want to position a top
aligned object, underneath whats already there, what you could do is, when
you create the panel, and after you set its parent and alignment, set its
top property to some rediculously high number.  If you want to have it
appear on top of the existing objects, set its top property to 0.

Quote
Sean O wrote in message <[email protected]>...
>In the last sentence, I meant:

>"Why is this different from design-time when all subsequently-created
panels
>appear below Panel2"

>Thanks,

>Sean

Re:Align := alTop


You may not have understood the question, but you're answer helps a lot.
When I created the panels, I guess the default value for Top is zero, so of
course the panel will appear above all other controls. Thanks for your help.

Sean.

Other Threads