-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathfrmProgress.cs
55 lines (46 loc) · 1.15 KB
/
frmProgress.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
namespace ReallyEasyResize
{
public partial class frmProgress : Form
{
public delegate void ProgressDelegate();
private frmMain main;
public frmProgress(frmMain main)
{
InitializeComponent();
this.main = main;
}
/**
* Setup progress bar
*/
public void Setup(int max)
{
progress.Value = 0;
progress.Maximum = max;
}
/**
* Increment progress bar
*/
public void Increment()
{
progress.Value++;
if (progress.Value == progress.Maximum) {
timClose.Start();
}
}
/**
* Closing is delayed a little so the user sees 100% progress
*/
private void timClose_Tick(object sender, EventArgs e)
{
this.Close();
this.main.Complete();
}
}
}