Siticone Logo
Siticone UI
DOCS
v2025.12.15
Docs Animate Container

Siticone Animate Container

The SiticoneAnimateContainer component adds fluid, high-performance animations to any Windows Forms container control (Panels, Forms, GroupBoxes, etc.). It supports complex entry and exit transitions, staggered child control animations, and visual effects like blur, slide, and wipe, enabling modern, cinema-like UI experiences.

Core Animation Settings

Fundamental properties defining what gets animated and how the motion looks.

Property Type Description & Usage Example
TargetContainer Control animator.TargetContainer = this.panelMain; The specific container (Panel, Form, UserControl) to apply effects to.
ContainerAnimationTypeIn AnimationType animator.ContainerAnimationTypeIn = ContainerAnimationType.Slide; The effect used when the container appears (Show).
ContainerAnimationTypeOut AnimationType animator.ContainerAnimationTypeOut = ContainerAnimationType.Fade; The effect used when the container disappears (Hide).
AnimationDuration int animator.AnimationDuration = 500; Total time in milliseconds for the animation to complete.
EasingType EasingType animator.EasingType = AnimationEasingType.EaseOut; Mathematical curve for acceleration (Linear, Bounce, Elastic, etc.).
SlideDirection AnimationDirection animator.SlideDirection = AnimationDirection.Right; Direction of movement for Slide, Wipe, and Fold animations.

Behavior Configuration

Controls when animations trigger and how they handle state changes.

Property Type Description & Usage Example
AnimateOnShow bool animator.AnimateOnShow = true; Automatically triggers animation when Visible becomes true.
AnimateOnHide bool animator.AnimateOnHide = true; Automatically triggers animation when Visible becomes false.
ReverseExitAnimation bool animator.ReverseExitAnimation = true; If true, the exit animation plays the entry animation backwards (e.g., Slide Right becomes Slide Left).
HideBeforeAnimation bool animator.HideBeforeAnimation = true; Ensures the container is invisible before the entry animation starts to prevent flickering.

Child Control Animations

Settings to animate individual controls inside the container sequentially or simultaneously.

Property Type Description & Usage Example
AnimateChildControls bool animator.AnimateChildControls = true; Applies animation effects to buttons, labels, and textboxes inside the container.
AnimateControlsOnly bool animator.AnimateControlsOnly = false; If true, the container background stays static while content moves.
ChildControlDelay int animator.ChildControlDelay = 50; Delay in ms between each child control starting its animation (Stagger effect).
ControlAnimationOrder ChildOrder animator.ControlAnimationOrder = ChildControlAnimationOrder.TopToBottom; Sequence logic: LeftToRight, TopToBottom, Random, etc.
FadeChildControls bool animator.FadeChildControls = true; Applies transparency fading to children alongside movement.

Public Methods

Programmatic control over animations and transitions.

StartAnimation(bool isEntering)
// Manually triggers the animation.
// true = Entry animation (Show), false = Exit animation (Hide).
siticoneAnimateContainer1.StartAnimation(true);
TransitionControls(from, to, type)
// Smoothly transitions between two controls (e.g., Wizard pages).
// Automatically handles hiding 'panel1' and showing 'panel2'.
siticoneAnimateContainer1.TransitionControls(
    panelStep1, 
    panelStep2, 
                ContainerAnimationType.Slide
);
StartPulsing()
// Creates a heartbeat/pulse effect on the container.
// Useful for drawing attention to validation errors or notifications.
siticoneAnimateContainer1.StartPulsing(
    pulseCount: 3, 
    pulseInterval: 800, 
    pulseScale: 1.1f
);
Highlight(Color, Duration)
// Temporarily flashes the container border/background.
siticoneAnimateContainer1.Highlight(Color.Yellow, 1000);

Events

Event Description
AnimationStarted Fired immediately when an animation sequence begins.
AnimationCompleted Fired when the animation finishes and the control is in its final state.
AnimationProgress Fired repeatedly during animation frames (0.0 to 1.0). Useful for syncing other UI elements.
TransitionEnd Fired when TransitionControls completes the swap.

Enumerations

ContainerAnimationType Enum
public enum ContainerAnimationType
{
    None, Fade, Slide, Scale, Rotate, 
    Bounce, Flip, Blur, Wipe, Ripple, Fold
}

Detailed Usage Examples

Example 1: Smooth Form Entrance

Apply a professional fade-in and slide-up effect when a form loads.

C# - Form Load Animation
public LoginForm()
{
                InitializeComponent();
    
                var animator = new SiticoneAnimateContainer(this.components);
    animator.TargetContainer = this; // Target the form itself
    
                // Configure for "Slide Up + Fade" effect
    animator.ContainerAnimationTypeIn = ContainerAnimationType.Slide;
    animator.SlideDirection = AnimationDirection.Up;
    animator.AnimationDuration = 700;
    animator.EasingType = AnimationEasingType.EaseOut;
    
                // Ensure form starts hidden for the effect
    animator.AnimateOnShow = true;
    animator.HideBeforeAnimation = true;
}

Example 2: Animated Side Menu

Slide a navigation drawer in and out based on a hamburger button click.

C# - Drawer Toggle
private void btnMenu_Click(object sender, EventArgs e)
{
                // Configure animation logic
    animatorSideMenu.AnimationDuration = 400;
    animatorSideMenu.SlideDirection = AnimationDirection.Left;
    animatorSideMenu.ContainerAnimationTypeIn = ContainerAnimationType.Slide;
    animatorSideMenu.ContainerAnimationTypeOut = ContainerAnimationType.Slide;

                // Toggle visibility - animation triggers automatically due to AnimateOnShow/Hide
    pnlSideMenu.Visible = !pnlSideMenu.Visible;
}

Example 3: Wizard Page Transition

Seamlessly transition between panels in a multi-step wizard using TransitionControls.

C# - Wizard Navigation
private void btnNext_Click(object sender, EventArgs e)
{
                // Transition from Step 1 to Step 2
                // Uses "Wipe" effect for a modern feel
    wizardAnimator.SlideDirection = AnimationDirection.Left;
    
    wizardAnimator.TransitionControls(
        pnlStep1, 
        pnlStep2, 
                ContainerAnimationType.Wipe
    );
}

private void btnBack_Click(object sender, EventArgs e)
{
                // Go back with reverse direction
    wizardAnimator.SlideDirection = AnimationDirection.Right;
    
    wizardAnimator.TransitionControls(
        pnlStep2, 
        pnlStep1, 
                ContainerAnimationType.Wipe
    );
}

Example 4: Staggered List Entrance

Animate a list of items (e.g., cards or buttons) entering one by one for a cascading effect.

C# - Staggered Controls
private void LoadDashboard()
{
                // Target the container holding the cards
    listAnimator.TargetContainer = flowLayoutPanelCards;
    
                // Set up Child Control Animation
    listAnimator.AnimateControlsOnly = true; // Don't animate the panel background
    listAnimator.AnimateChildControls = true;
    
                // Critical: Set delay for the cascade effect
    listAnimator.ChildControlDelay = 100; // 100ms between each item
    listAnimator.ControlAnimationOrder = ChildControlAnimationOrder.TopToBottom;
    
                // Animation Style
    listAnimator.SlideDirection = AnimationDirection.Up;
    listAnimator.ContainerAnimationTypeIn = ContainerAnimationType.Slide;
    
                // Trigger
    listAnimator.StartAnimation(true);
}

Example 5: Visual Feedback for Errors

Use the StartPulsing method to alert the user to a validation error.

C# - Error Feedback
private void ValidateInput()
{
                if (string.IsNullOrEmpty(txtUsername.Text))
    {
                // Attach animator to the input container temporarily
        errorAnimator.TargetContainer = pnlUsernameContainer;
        
                // Highlight Red
        errorAnimator.Highlight(Color.Red, 500);
        
                // Pulse 3 times to grab attention
        errorAnimator.StartPulsing(
            pulseCount: 3,
            pulseInterval: 200,
            pulseScale: 1.05f
        );
    }
}