基线 SVN r240
SVN-Revision: r240
This commit is contained in:
@@ -0,0 +1,118 @@
|
||||
/******************************
|
||||
* 说明:自定义复选文本控件
|
||||
* 创建人:龚宇超
|
||||
* 创建日期:2017-08-07
|
||||
* 修改人:
|
||||
* 修改日期:
|
||||
* 修改备注:
|
||||
* 版本:1.0.0.0
|
||||
******************************/
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel;
|
||||
using System.Drawing;
|
||||
using System.Data;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Windows.Forms;
|
||||
using DevExpress.XtraEditors;
|
||||
|
||||
namespace Lskj.Control
|
||||
{
|
||||
/// <summary>
|
||||
/// 复选文本控件
|
||||
/// </summary>
|
||||
public partial class LabelCheckEdit : BaseUserControl
|
||||
{
|
||||
public CheckEdit TextEdit { get { return this.checkEdt; } }
|
||||
|
||||
public LabelCheckEdit()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para>说明:设置控件显示文本</para>
|
||||
/// <para>创建人:龚宇超</para>
|
||||
/// <para>创建日期:2017-08-07 </para>
|
||||
/// <para>修改人:</para>
|
||||
/// <para>修改日期:</para>
|
||||
/// <para>修改备注:</para>
|
||||
/// <para>版本:1.0</para>
|
||||
/// </summary>
|
||||
/// <value>The label text.</value>
|
||||
/// <param name="text">显示Lebel文本</param>
|
||||
public override string LabelText
|
||||
{
|
||||
get
|
||||
{
|
||||
return this.checkEdt.Text;
|
||||
}
|
||||
set
|
||||
{
|
||||
this.checkEdt.Text = value;
|
||||
this.Width = checkEdt.Width + PaddingLeft;
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// <para>说明:设置控件值</para>
|
||||
/// <para>创建人:龚宇超</para>
|
||||
/// <para>创建日期:2017-08-07 </para>
|
||||
/// <para>修改人:</para>
|
||||
/// <para>修改日期:</para>
|
||||
/// <para>修改备注:</para>
|
||||
/// <para>版本:1.0</para>
|
||||
/// </summary>
|
||||
public override string EditText
|
||||
{
|
||||
get
|
||||
{
|
||||
return string.IsNullOrWhiteSpace(checkEdt.EditValue + "") ? "0" : checkEdt.EditValue.ToString().ToLower() == "true" ? "1" : "0";
|
||||
}
|
||||
set
|
||||
{
|
||||
string val = string.IsNullOrWhiteSpace(value) || "0".Equals(value) || "false".Equals(value, StringComparison.OrdinalIgnoreCase) ? "0" : "1";
|
||||
this.checkEdt.EditValue = Convert.ToBoolean(Convert.ToInt32(val));
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// 只读文本颜色
|
||||
/// </summary>
|
||||
/// <value>The color of the read only label.</value>
|
||||
public override bool ReadOnly
|
||||
{
|
||||
get
|
||||
{
|
||||
return base.ReadOnly;
|
||||
}
|
||||
set
|
||||
{
|
||||
base.ReadOnly = value;
|
||||
this.checkEdt.Properties.ReadOnly = value;
|
||||
this.checkEdt.ForeColor = value ? base.ReadOnlyLabelForceColor : Required ? base.RequiredLabelForceColor : base.DefaultLabelForceColor;
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// 必填文本颜色
|
||||
/// </summary>
|
||||
/// <value>The color of the required label.</value>
|
||||
public override bool Required
|
||||
{
|
||||
get
|
||||
{
|
||||
return base.Required;
|
||||
}
|
||||
set
|
||||
{
|
||||
base.Required = value;
|
||||
if (value)
|
||||
{
|
||||
this.checkEdt.ForeColor = base.RequiredLabelForceColor;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user