各位大侠!
小弟是新手!看到好些软件,用户登录成功后打开主界面,此时界面会以慢慢展开的效果打开,请问这种效果是怎么实现的啊?初次发帖,请各位前辈多多关照!

解决方案 »

  1.   

    可以用代码实现。。最简单的思路,弄个timer,设置时间,根据时间,加长或加宽form
      

  2.   

    http://www.cnblogs.com/peterzb/archive/2009/06/30/1514336.html
      

  3.   

    去网上搜些把,多的是,2楼可以实现,也可以控制他的透明度,渐显,或者加载一段flash
      

  4.   

    using System;
    using System.Collections.Generic;
    using System.Text;
    using System.Runtime.InteropServices;
    using System.Windows.Forms;namespace Utility
    {
        /// <summary>
        /// Base form class that provides fading/sliding effects on open/close of the form.
        /// </summary>
        public abstract class FadeForm : Form
        {
            #region Win32        const int AW_HIDE = 0X10000;
            const int AW_ACTIVATE = 0X20000;
            const int AW_HOR_POSITIVE = 0X1;
            const int AW_HOR_NEGATIVE = 0X2;
            const int AW_SLIDE = 0X40000;
            const int AW_BLEND = 0X80000;        [DllImport("user32.dll", CharSet = CharSet.Auto)]
            private static extern int AnimateWindow
            (IntPtr hwand, int dwTime, int dwFlags);        #endregion        #region Variables        private bool _UseSlideAnimation;        #endregion        #region Constructor        /// <summary>
            /// Initializes a new instance of the <see cref="FadeForm"/> class.
            /// </summary>
            public FadeForm() : this(false) { }
            
            /// <summary>
            /// Initializes a new instance of the <see cref="FadeForm"/> class.
            /// </summary>
            /// <param name="useSlideAnimation">if set to <c>true</c> [use slide animation].</param>
            public FadeForm(bool useSlideAnimation)
            {
                _UseSlideAnimation = useSlideAnimation;
            }        #endregion        #region Overrides        /// <summary>
            /// Raises the <see cref="E:System.Windows.Forms.Form.Load"/> event.
            /// </summary>
            /// <param name="e">An <see cref="T:System.EventArgs"/> that contains the event data.</param>
            protected override void OnLoad(EventArgs e)
            {
                base.OnLoad(e);
                AnimateWindow(this.Handle, 1000, AW_ACTIVATE | (_UseSlideAnimation ? AW_HOR_POSITIVE | AW_SLIDE : AW_BLEND));
            }        /// <summary>
            /// Raises the <see cref="E:System.Windows.Forms.Form.Closing"/> event.
            /// </summary>
            /// <param name="e">A <see cref="T:System.ComponentModel.CancelEventArgs"/> that contains the event data.</param>
            protected override void OnClosing(System.ComponentModel.CancelEventArgs e)
            {
                base.OnClosing(e);
                if (e.Cancel == false)
                {
                    AnimateWindow(this.Handle, 1000, AW_HIDE | (_UseSlideAnimation ? AW_HOR_NEGATIVE | AW_SLIDE : AW_BLEND));
                }
            }        #endregion    }
    }
      

  5.   

    我在timer_Tick事件里写了
    this.Width += 1;
    this.Height += 1;
    但是界面只能往左和往下伸展,怎样才能上下左右同时伸展呢
      

  6.   

    找个第三方控件是最好的!或者用WPF来做,要不你用什么Timer太耗资源了,