개정판 f31645b6
dev issue #000 : progressBarControl 추가
Change-Id: I55520ddd338eb9054466e1e3e21e9c859b4f9d92
DTI_PID/SPPIDConverter/Form/SPPIDSplashScreen.cs | ||
---|---|---|
3 | 3 |
using System.ComponentModel; |
4 | 4 |
using System.Data; |
5 | 5 |
using System.Drawing; |
6 |
using System.Runtime.InteropServices; |
|
6 | 7 |
using System.Text; |
7 | 8 |
using System.Windows.Forms; |
8 | 9 |
using DevExpress.XtraSplashScreen; |
9 | 10 |
|
11 |
|
|
10 | 12 |
namespace Converter.SPPID |
11 | 13 |
{ |
12 | 14 |
public partial class SPPIDSplashScreen : DevExpress.XtraSplashScreen.SplashScreen |
... | ... | |
26 | 28 |
if (command == SplashScreenCommand.SetProgress) |
27 | 29 |
{ |
28 | 30 |
int pos = (int)arg; |
29 |
//progressBarControl.Position = pos; |
|
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 = stepText; |
|
30 | 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.SetParent) |
|
46 |
SetParent(Handle, (IntPtr)arg); |
|
47 |
else if (command == SplashScreenCommand.ClearParent) |
|
48 |
SetParent(Handle, (IntPtr)0); |
|
31 | 49 |
} |
32 | 50 |
|
51 |
[DllImport("user32.dll", SetLastError = true)] |
|
52 |
static extern IntPtr SetParent(IntPtr hWndChild, IntPtr hWndNewParent); |
|
53 |
[DllImport("user32")] |
|
54 |
public static extern int GetParent(IntPtr hwnd); |
|
55 |
|
|
33 | 56 |
#endregion |
34 | 57 |
|
35 | 58 |
public enum SplashScreenCommand |
36 | 59 |
{ |
37 | 60 |
SetProgress, |
61 |
SetAllStep, |
|
62 |
SetStep, |
|
63 |
SetDocumentName, |
|
64 |
SetParent, |
|
65 |
ClearParent |
|
38 | 66 |
} |
39 | 67 |
} |
40 | 68 |
} |
내보내기 Unified diff