첨부 실행 코드는 나눔고딕코딩 폰트를 사용합니다.
728x90
반응형
728x170

TestProject.zip
다운로드

▶ MainForm.cs

using System;
using System.Windows.Forms;

using DevExpress.XtraEditors;
using DevExpress.XtraSplashScreen;

namespace TestProject
{
    /// <summary>
    /// 메인 폼
    /// </summary>
    public partial class MainForm : XtraForm
    {
        //////////////////////////////////////////////////////////////////////////////////////////////////// Field
        ////////////////////////////////////////////////////////////////////////////////////////// Private

        #region Field

        /// <summary>
        /// 오버레이 윈도우 옵션
        /// </summary>
        private OverlayWindowOptions option;

        /// <summary>
        /// 오버레이 스플래시 스크린 핸들
        /// </summary>
        private IOverlaySplashScreenHandle handle;

        /// <summary>
        /// 타이머
        /// </summary>
        private Timer timer;

        #endregion

        //////////////////////////////////////////////////////////////////////////////////////////////////// Constructor
        ////////////////////////////////////////////////////////////////////////////////////////// Public

        #region 생성자 - MainForm()

        /// <summary>
        /// 생성자
        /// </summary>
        public MainForm()
        {
            InitializeComponent();

            #region 오버레이 윈도우 옵션을 설정한다.

            this.option = new OverlayWindowOptions();

            this.option.Opacity = 0.5d;

            #endregion
            #region 오버레이 스플래시 스크린 핸들을 설정한다.

            this.handle = null;

            #endregion
            #region 타이머를 설정한다.

            this.timer = new Timer();

            this.timer.Interval = 3000;

            #endregion
            #region 이벤트를 설정한다.

            this.timer.Tick      += timer_Tick;
            this.runButton.Click += runButton_Click;

            #endregion
        }

        #endregion

        //////////////////////////////////////////////////////////////////////////////////////////////////// Method
        ////////////////////////////////////////////////////////////////////////////////////////// Private

        #region 타이머 틱 처리하기 - timer_Tick(sender, e)

        /// <summary>
        /// 타이머 틱 처리하기
        /// </summary>
        /// <param name="sender">이벤트 발생자</param>
        /// <param name="e">이벤트 인자</param>
        private void timer_Tick(object sender, EventArgs e)
        {
            this.timer.Stop();

            if(this.handle != null)
            {
                SplashScreenManager.CloseOverlayForm(this.handle);

                this.handle = null;
            }
        }

        #endregion
        #region 실행 버튼 클릭시 처리하기 - runButton_Click(sender, e)

        /// <summary>
        /// 실행 버튼 클릭시 처리하기
        /// </summary>
        /// <param name="sender">이벤트 발생자</param>
        /// <param name="e">이벤트 인자</param>
        private void runButton_Click(object sender, EventArgs e)
        {
            this.handle = SplashScreenManager.ShowOverlayForm(this, this.option);

            this.timer.Start();
        }

        #endregion
    }
}
728x90
반응형
그리드형(광고전용)
Posted by icodebroker

댓글을 달아 주세요