using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
using System.Data;
using System.Text;
using System.Windows.Forms;
namespace GameProcessBar
{
public partial class GameProcessBar : UserControl
{
public GameProcessBar()
{
InitializeComponent();
}
int min = 0;
int max = 100;
int val = 0;
Image im;
//int mini = (max - val) / 60;
//int sec = (max - val) % 60;
//string text = string.Format("{0} 分 {1} 秒", mini, sec);
//Font font = new System.Drawing.Font("宋体", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
//g.DrawString(text, font, Brushes.Black, 140, 5);
Draw3DBorder(g);
myBrush.Dispose();
g.Dispose();
}
public int Minimum
{
get
{
return min;
}
set
{
if (value < 0)
{
min = 0;
}
if (value > max)
{
max = value;
}
min = value;
if (val < min)
{
val = min;
}
this.Invalidate();
}
}
public int Maximum
{
get
{
return max;
}
set
{
if (value < min)
{
min = value;
}
max = value;
if (val > max)
{
val = max;
}
this.Invalidate();
}
}
public int Value
{
get
{
return val;
}
set
{
int oldVal = val;
if (val < min)
{
val = min;
}
else if (val > max)
{
val = max;
}
else
{
val = value;
}