简体   繁体   中英

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

If I want to smoothly switch between forms (ie the sliding transition from Microsoft PowerPoint), how can I do this? 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. =)

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM