You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

56 lines
1.2 KiB
C#

1 year ago
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 Mesnac.Controls.ChemicalWeighing
{
public partial class HwProgressBar : UserControl
{
private int _val;//进度值
private int _maxNum;//最大值
public HwProgressBar()
{
InitializeComponent();
}
public string MaxName { get; set; }
public string ValName { get; set; }
/// <summary>
/// 当前值
/// </summary>
public int Val
{
get => _val;
set
{
_val = value;
}
}
/// <summary>
/// 最大值
/// </summary>
public int MaxNumValue
{
get => _maxNum;
set
{
_maxNum = value;
}
}
protected override void OnPaint(PaintEventArgs e)
{
this.xProgressBar1.Maximum = _maxNum;
this.xProgressBar1.Value = _val;
}
}
}