【问题标题】:Slide Window Animation滑动窗口动画
【发布时间】:2012-03-05 19:45:46
【问题描述】:

我正在为 C# 和 WPF 中的窗口制作动画。在一个简单的 2 窗口应用程序中,我想要一个窗口来获取前一个窗口的坐标,并且在加载它时我想将其高度属性从 0 设置为前一个窗口的高度。我已经搜索了许多帖子,例如幻灯片效果到矩形或图像,但我无法将它们应用于窗口。请帮助我了解加载时窗口的滑动高度。如果您有此工作,请发布任何代码或项目链接提前谢谢。

【问题讨论】:

    标签: c# wpf


    【解决方案1】:

    你可以玩DoubleAnimation

                DoubleAnimation anim = new DoubleAnimation();
                anim.From = 125;   //Height of the container before animation
                anim.To = 0;       //Height of the container after animation
                anim.SpeedRatio = 3;
                mainWindow.BeginAnimation(Window.HeightProperty, anim);
    

    【讨论】:

      猜你喜欢
      • 2021-10-03
      • 2023-03-05
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2012-08-08
      • 2012-10-20
      • 1970-01-01
      • 2021-02-20
      相关资源
      最近更新 更多