프로젝트

일반

사용자정보

통계
| 개정판:

hytos / DTI_PID / SPPIDConverter / Form / SPPIDSplashScreen.cs @ 10a61578

이력 | 보기 | 이력해설 | 다운로드 (2.25 KB)

1 ca214bc3 gaqhf
using System;
2
using System.Collections.Generic;
3
using System.ComponentModel;
4
using System.Data;
5
using System.Drawing;
6 f31645b6 gaqhf
using System.Runtime.InteropServices;
7 ca214bc3 gaqhf
using System.Text;
8
using System.Windows.Forms;
9
using DevExpress.XtraSplashScreen;
10
11 f31645b6 gaqhf
12 ca214bc3 gaqhf
namespace Converter.SPPID
13
{
14
    public partial class SPPIDSplashScreen : DevExpress.XtraSplashScreen.SplashScreen
15
    {
16
        public SPPIDSplashScreen()
17
        {
18
            InitializeComponent();
19 965eb728 gaqhf
            this.labelControl1.Text = "Copyright © 2000-" + DateTime.Now.Year.ToString();
20 ca214bc3 gaqhf
        }
21
22
        #region Overrides
23
24
        public override void ProcessCommand(Enum cmd, object arg)
25
        {
26
            base.ProcessCommand(cmd, arg);
27
            SplashScreenCommand command = (SplashScreenCommand)cmd;
28
            if (command == SplashScreenCommand.SetProgress)
29
            {
30
                int pos = (int)arg;
31 f31645b6 gaqhf
                if (progressBarControl.Properties.Maximum >= pos)
32
                    progressBarControl.Position = pos;
33
            }
34
            else if (command == SplashScreenCommand.SetStep)
35
            {
36
                string stepText = (string)arg;
37 d5ec4d0f gaqhf
                labelStep.Text = "Step : " + stepText;
38 ca214bc3 gaqhf
            }
39 f31645b6 gaqhf
            else if (command == SplashScreenCommand.SetAllStep)
40
            {
41
                int pos = (int)arg;
42
                progressBarControl.Properties.Maximum = pos;
43
                progressBarControl.Position = 0;
44
            }
45 d5ec4d0f gaqhf
            else if (command == SplashScreenCommand.SetDocumentName)
46
            {
47
                string text = (string)arg;
48
                labelDocument.Text = text;
49
            }
50 f31645b6 gaqhf
            else if (command == SplashScreenCommand.SetParent)
51
                SetParent(Handle, (IntPtr)arg);
52
            else if (command == SplashScreenCommand.ClearParent)
53
                SetParent(Handle, (IntPtr)0);
54 ca214bc3 gaqhf
        }
55
56 f31645b6 gaqhf
        [DllImport("user32.dll", SetLastError = true)]
57
        static extern IntPtr SetParent(IntPtr hWndChild, IntPtr hWndNewParent);
58
        [DllImport("user32")]
59
        public static extern int GetParent(IntPtr hwnd);
60
61 ca214bc3 gaqhf
        #endregion
62
63
        public enum SplashScreenCommand
64
        {
65
            SetProgress,
66 f31645b6 gaqhf
            SetAllStep,
67
            SetStep,
68
            SetDocumentName,
69
            SetParent,
70
            ClearParent
71 ca214bc3 gaqhf
        }
72
    }
73
}
클립보드 이미지 추가 (최대 크기: 500 MB)