Files

100 lines
2.5 KiB
C#
Raw Permalink Normal View History

2026-08-04 18:36:40 +08:00
using System;
using System.ComponentModel;
using System.Windows.Forms;
namespace JinYuan.ControlLib
{
[DefaultEvent("ControlDoubleClick")]
public partial class TextSet2 : UserControl
{
public TextSet2()
{
InitializeComponent();
}
//private int titleScale = 50;
//[Browsable(true)]
//[Category("自定义属性")]
//[Description("设置或获取标题所占比例")]
//public int TitleScale
//{
// get { return titleScale; }
// set
// {
// titleScale = value;
// this.MainTableLayoutControl.ColumnStyles[0] = new ColumnStyle(SizeType.Percent, titleScale);
// }
//}
//private int valueScale = 30;
//[Browsable(true)]
//[Category("自定义属性")]
//[Description("设置或获取数据所占比例")]
//public int ValueScale
//{
// get { return valueScale; }
// set
// {
// valueScale = value;
// this.MainTableLayoutControl.ColumnStyles[1] = new ColumnStyle(SizeType.Percent, valueScale);
// }
//}
private string titleName = "参数名称设置";
[Browsable(true)]
[Category("自定义属性")]
[Description("设置或获取参数名称")]
public string TitleName
{
get { return titleName; }
set
{
titleName = value;
this.lbl_Title.Text = titleName;
}
}
private string currentValue = "0.0";
[Browsable(true)]
[Category("自定义属性")]
[Description("设置或获取当前数值")]
public string CurrentValue
{
get { return currentValue; }
set
{
currentValue = value;
this.lbl_Value.Text = currentValue;
}
}
[Browsable(true)]
[Category("自定义属性")]
[Description("设置或获取绑定变量名称")]
public string BindVarName { get; set; }
[Browsable(true)]
[Category("自定义事件")]
[Description("控件双击事件")]
public event EventHandler ControlDoubleClick;
private void lbl_Value_DoubleClick(object sender, EventArgs e)
{
if (ControlDoubleClick != null)
{
ControlDoubleClick(this, e);
}
}
}
}