Window load style

kiwis

Member
Joined
Apr 23, 2007
Messages
7
Programming Experience
Beginner
I've seen apps where the window flys in or slides in from the side when it loads, how does this happen?
 
What you saw may have been using AnimateWindow function, see also pinvoke.net: animatewindow (user32)

jmcilhinney has made that API easier available here: Animate Window Control - VBForums
Not sure how/if that works with WPF though. (a window handle is available using WindowInteropHelper class)

WPF however has lots of built in support for animation, see for example Animation Overview
Here's one basic example derived from one of the examples there, something you can put in the windows constructor or Loaded event handler:
        Dim animation As New DoubleAnimation()
        With animation
            .From = -300
            .To = 300
            .Duration = New Duration(TimeSpan.FromMilliseconds(500))
        End With
        Me.BeginAnimation(Window.LeftProperty, animation)
 
Back
Top