init lserp cs 5.0
This commit is contained in:
@@ -0,0 +1,125 @@
|
||||
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.XtraRichEdit;
|
||||
|
||||
namespace Lskj.MyControl
|
||||
{
|
||||
public partial class LabelRichEdit : UserControl
|
||||
{
|
||||
|
||||
/// <summary>
|
||||
/// Label填充值
|
||||
/// </summary>
|
||||
protected int PaddingLeft = 7;
|
||||
/// <summary>
|
||||
/// 只读颜色
|
||||
/// </summary>
|
||||
protected Color ReadOnlyLabelForceColor = Color.FromArgb(160, 160, 160);
|
||||
/// <summary>
|
||||
/// 必填颜色
|
||||
/// </summary>
|
||||
protected Color RequiredLabelForceColor = Color.Blue;
|
||||
/// <summary>
|
||||
/// Label 默认颜色
|
||||
/// </summary>
|
||||
protected Color DefaultLabelForceColor = Color.Black;
|
||||
|
||||
/// <summary>
|
||||
/// 富文本控件
|
||||
/// </summary>
|
||||
public RichEditControl TextEdit { get { return richEditControl1; } }
|
||||
|
||||
public LabelRichEdit()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para>说明:设置控件显示文本</para>
|
||||
/// <para>创建人:龚宇超</para>
|
||||
/// <para>创建日期:2017-08-07 </para>
|
||||
/// <para>修改人:</para>
|
||||
/// <para>修改日期:</para>
|
||||
/// <para>修改备注:</para>
|
||||
/// <para>版本:1.0</para>
|
||||
/// </summary>
|
||||
/// <param name="text">显示Lebel文本</param>
|
||||
public string LabelText
|
||||
{
|
||||
get
|
||||
{
|
||||
return this.lblText.Text;
|
||||
}
|
||||
set
|
||||
{
|
||||
this.lblText.Text = value;
|
||||
this.plLeft.Width = this.lblText.Width + PaddingLeft;
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// <para>说明:设置控件值</para>
|
||||
/// <para>创建人:龚宇超</para>
|
||||
/// <para>创建日期:2017-08-07 </para>
|
||||
/// <para>修改人:</para>
|
||||
/// <para>修改日期:</para>
|
||||
/// <para>修改备注:</para>
|
||||
/// <para>版本:1.0</para>
|
||||
/// </summary>
|
||||
public string EditText
|
||||
{
|
||||
get
|
||||
{
|
||||
return this.richEditControl1.RtfText;
|
||||
}
|
||||
set
|
||||
{
|
||||
if (value.StartsWith(@"{\rtf"))
|
||||
this.richEditControl1.RtfText = value;
|
||||
else
|
||||
this.richEditControl1.Text = value;
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// 是否只读
|
||||
/// </summary>
|
||||
/// <value>The color of the read only label.</value>
|
||||
public bool ReadOnly
|
||||
{
|
||||
get
|
||||
{
|
||||
return !this.TextEdit.Enabled;
|
||||
}
|
||||
set
|
||||
{
|
||||
this.TextEdit.Enabled = !value;
|
||||
this.lblText.ForeColor = value ? ReadOnlyLabelForceColor : Required ? RequiredLabelForceColor : DefaultLabelForceColor;
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// 必填文本颜色
|
||||
/// </summary>
|
||||
/// <value>The color of the required label.</value>
|
||||
public bool Required
|
||||
{
|
||||
get
|
||||
{
|
||||
return this.Required;
|
||||
}
|
||||
set
|
||||
{
|
||||
Required = value;
|
||||
if (value)
|
||||
{
|
||||
this.lblText.ForeColor = RequiredLabelForceColor;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user