Icon View Thread

The following is the text of the current message along with any replies.
Messages 1 to 3 of 3 total
Thread Animation - slide in from bottom
Mon, Jul 2 2018 5:06 AMPermanent Link


Based on this old thread started by Trinione


I have code to slide in from the left, right and slide down from top.

But I cannot manage to get slide up from bottom to work.

This works for slide in from top:

procedure SlideInTop(AControl: TControl; AStyle: TAnimationStyle; ADuration: Integer);
  TempPosition: TLayoutPosition;
  with AControl do
        Visible := False;
        TempPosition := Layout.Position; // Save the current layout position
        DefineLayout; // Peg the defined dimensions of the control based upon the current layout
        Layout.Position := lpNone;
        Animations.Top.Style := asNone;
        Animations.Visible.Style := asNone;
        Animations.Left.Style := asNone;
        Top := -Parent.ClientHeight;
        EndUpdate; // Render

        Visible := True;
        Animations.Top.Style := AStyle;
        Animations.Top.Duration := ADuration;
        Layout.Position := TempPosition; // Set the layout to the saved layout
        EndUpdate; // Render (with animation)

I tried setting Top := 0 but that did not work.

Can somebody point me in the right direction?


// Thom
Mon, Jul 2 2018 5:45 AMPermanent Link

Matthew Jones

thomh wrote:

> Can somebody point me in the right direction?

Ho ho. But have you tried setting Top to +Parent.ClientHeight (instead of negative)? The key being that you want it to end up at zero, and the negative one starts it above, so you need to start it below.


Matthew Jones
Tue, Jul 3 2018 1:18 PMPermanent Link

Tim Young [Elevate Software]

Elevate Software, Inc.


Email timyoung@elevatesoft.com


Just FYI, there's a TControl method that does the sliding work for you:


Tim Young
Elevate Software