DevExpress 组合控件系列(1):xtraTabControl 切换动画效果

只是根据示例,简单研究下而已。有兴趣朋友可以深入了解下

效果图:(晨曦CZB)

 

DevExpress 组合控件系列(1):xtraTabControl 切换动画效果_第1张图片

代码:

  public Form1()
        {
            InitializeComponent();

            this.Load += (s, e) =>
            {
                Control animatedControl = this.xtraTabControl1;

                this.memoEdit1.Text = @"using System;
                namespace HelloWorldApplication
                {
                    /* 类名为 HelloWorld */
                    class HelloWorld
                    {
                        /* main函数 */
                        static void Main(string[] args)
                        {
                            /* 我的第一个 C# 程序 */
                            Console.WriteLine(""Hello World!"");
                            Console.ReadKey();
                        }
                    }
                }";

                if (transitionManager1.Transitions[animatedControl] == null)
                {
                    transitionManager1.Transitions.Add(new Transition
                    {
                        Control = animatedControl
                    });
                }

                this.xtraTabControl1.SelectedPageChanging += (d, f) =>
                {
                    if (animatedControl == null) return;
                    transitionManager1.StartTransition(animatedControl);

                    transitionManager1.Transitions[animatedControl].TransitionType = new CombTransition();
                };

                this.xtraTabControl1.SelectedPageChanged += (d, f) =>
                {
                    transitionManager1.EndTransition();
                };

                this.transitionManager1.CustomTransition += (d, f) =>
                {
                    f.Regions = new Rectangle[] { this.xtraTabPage1.Bounds };
                    f.EasingFunction = new DevExpress.Data.Utils.BackEase();
                };
            };
        }

 

你可能感兴趣的:(DevExpress)