Creating Storyboard in code behind in WPF

后端 未结 3 1199
忘掉有多难
忘掉有多难 2020-12-05 09:57

The following code is working fine.


    
        
                   


        
3条回答
  •  感情败类
    2020-12-05 10:43

    Adding djerry's comment sample code would look like this:

    var anim = new DoubleAnimation {
                                    From = 1920, 
                                    To = 1, 
                                   };
    
    wnd.BeginAnimation(Window.LeftProperty, anim); 
    

    and you would have to have this code in window loaded event handler. Hope this helps.

提交回复
热议问题