animateWindow

animateWindow(millisecs:   Integer
             animateType: Integer);

The animateWindow method of the Control class enables you to specify special animation effects (roll, slide, collapse, or expand) when showing or hiding a control.

Calling the method is equivalent to toggling the visible property of a control where the resulting show or hide of the control is animated.

When the control is not visible, calling the animateWindow method makes it visible. If the control is visible, calling the animateWindow method makes it invisible.

Use the millisecs parameter to specify the duration of the animation, in milliseconds. Typically, an animation takes 200 milliseconds to play.

The animateType parameter can be one of the Control class constants listed in the following table.

Class Constant Value Description
AnimateWindow_BottomToTop #8 Animates the window from bottom to top. This flag can be used with roll or slide animation. It is ignored when used with AnimateWindow_Center.
AnimateWindow_Center #10 Makes the window appear to collapse inward when the window is hidden or expand outward when the window is shown.
AnimateWindow_LeftToRight #1 Animates the window from left to right. This flag can be used with roll or slide animation. It is ignored when used with AnimateWindow_Center.
AnimateWindow_RightToLeft #2 Animates the window from right to left. This flag can be used with roll or slide animation. It is ignored when used with AnimateWindow_Center.
AnimateWindow_Slide #40000 Uses slide animation. By default, roll animation is used. This flag is ignored when used with AnimateWindow_Center.
AnimateWindow_TopToBottom #4 Animates the window from top to bottom. This flag can be used with roll or slide animation. It is ignored when used with AnimateWindow_Center.

The following code fragment examples demonstrate the use of the animateWindow method. In the following example, the method specifies that the control will slide the control into view from right to left when made visible and slide the control out of view right to left when made invisible.

frame1.animateWindow(200, Control.AnimateWindow_Slide + 
                     Control.AnimateWindow_RightToLeft);

In the following example, the method specifies that the control will roll into view from the top left corner when made visible and roll the control out of view towards the top left corner when made invisible.

frame1.animateWindow(200, Control.AnimateWindow_RightToLeft + 
                     Control.AnimateWindow_TopToBottom);

To animate the show of a control, position the control with its final position and size while invisible, and then call the animateWindow method to animate the window into that final position and size.

If the animateType parameter is not valid, the control is made visible or invisible without any animation.

An invalid parameter exception is generated if the value of the millisecs parameter is less than zero (0) or greater than 60,000.

The animation may not work effectively if other windows are moved at the same time. This applies to controls that are docked or aligned to their parents.