1
0
mirror of synced 2024-12-11 07:16:05 +01:00
Switch-Toolbox/Switch_Toolbox_Library/Forms/Custom/STProgressBar.cs
2019-04-29 19:50:12 -04:00

73 lines
1.6 KiB
C#

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace Switch_Toolbox.Library
{
public partial class STProgressBar : Form
{
public STProgressBar()
{
InitializeComponent();
}
public int Value
{
set
{
if (value > 100)
progressBar1.Value = 0;
else
progressBar1.Value = value;
if (value >= 100)
Close();
progressBar1.Refresh();
}
}
public bool IsConstant
{
set
{
if (value)
{
progressBar1.Style = ProgressBarStyle.Marquee;
progressBar1.MarqueeAnimationSpeed = 100;
}
else
progressBar1.Style = ProgressBarStyle.Blocks;
}
get
{
return progressBar1.Style == ProgressBarStyle.Marquee;
}
}
public string Task
{
set
{
label1.Text = value;
label1.Refresh();
}
}
private void ProgressBar_FormClosed(object sender, FormClosedEventArgs e)
{
}
private void ProgressBarWindow_Load(object sender, EventArgs e)
{
}
}
}