hytos / DTI_PID / SPPIDConverter / Form / SPPIDSplashScreen.cs @ 5761879d
이력 | 보기 | 이력해설 | 다운로드 (2.25 KB)
1 |
using System; |
---|---|
2 |
using System.Collections.Generic; |
3 |
using System.ComponentModel; |
4 |
using System.Data; |
5 |
using System.Drawing; |
6 |
using System.Runtime.InteropServices; |
7 |
using System.Text; |
8 |
using System.Windows.Forms; |
9 |
using DevExpress.XtraSplashScreen; |
10 |
|
11 |
|
12 |
namespace Converter.SPPID |
13 |
{ |
14 |
public partial class SPPIDSplashScreen : DevExpress.XtraSplashScreen.SplashScreen |
15 |
{ |
16 |
public SPPIDSplashScreen() |
17 |
{ |
18 |
InitializeComponent(); |
19 |
this.labelControl1.Text = "Copyright © 2000-" + DateTime.Now.Year.ToString(); |
20 |
} |
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 |
if (progressBarControl.Properties.Maximum >= pos) |
32 |
progressBarControl.Position = pos; |
33 |
} |
34 |
else if (command == SplashScreenCommand.SetStep) |
35 |
{ |
36 |
string stepText = (string)arg; |
37 |
labelStep.Text = "Step : " + stepText; |
38 |
} |
39 |
else if (command == SplashScreenCommand.SetAllStep) |
40 |
{ |
41 |
int pos = (int)arg; |
42 |
progressBarControl.Properties.Maximum = pos; |
43 |
progressBarControl.Position = 0; |
44 |
} |
45 |
else if (command == SplashScreenCommand.SetDocumentName) |
46 |
{ |
47 |
string text = (string)arg; |
48 |
labelDocument.Text = text; |
49 |
} |
50 |
else if (command == SplashScreenCommand.SetParent) |
51 |
SetParent(Handle, (IntPtr)arg); |
52 |
else if (command == SplashScreenCommand.ClearParent) |
53 |
SetParent(Handle, (IntPtr)0); |
54 |
} |
55 |
|
56 |
[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 |
#endregion |
62 |
|
63 |
public enum SplashScreenCommand |
64 |
{ |
65 |
SetProgress, |
66 |
SetAllStep, |
67 |
SetStep, |
68 |
SetDocumentName, |
69 |
SetParent, |
70 |
ClearParent |
71 |
} |
72 |
} |
73 |
} |