开发者

If I have multiple forms in one application how can I smoothly transition between them?

开发者 https://www.devze.com 2023-01-02 05:42 出处:网络
If I want to smoothly switch between forms (i.e the sliding transition from Microsoft PowerPoint), how can I do th开发者_如何学Cis? I am working with Visual Studios

If I want to smoothly switch between forms (i.e the sliding transition from Microsoft PowerPoint), how can I do th开发者_如何学Cis? I am working with Visual Studios C#.


If you're dealing with WPF, you can put them in a single Panel or Canvas, and apply/update continuously something to the "RenderTransform" property of the Panel/Canvas containing each. So,

        Transform t = new TranslateTransform(0.0f, 0.0f);
        panelA.RenderTransform = t;
        panelB.RenderTransform = t;

Then with your favorite timing method, update t slightly each tick.

I'm sure there are more elegant ways (baked XAML animations, etc.) but I'm pretty shaky on giving advice with those, as I'm not quite sure on how to make them work myself. =)

0

精彩评论

暂无评论...
验证码 换一张
取 消