using DevExpress.XtraEditors;
using Lskj.Business.Impl;
using Lskj.Control.Model;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
namespace Lskj.Control
{
//文本框带勾选
public partial class LabelCheckText : BaseUserControl
{
///
/// 复选框控件
///
/// The check edit.
public CheckEdit CheckEdit { get { return ckCheck; } }
///
/// 自动搜索框控件
///
// public AutoGridLookUp TextEdit { get { return labelTextEdit1.TextEdit; } }
///
/// 自定义文本框
///
/// The automatic text edit.
public LabelTextEdit LabelTextEdit { get { return labelTextEdit1; } }
///
/// 复选框日期控件
///
public TextEdit TextEdit { get { return labelTextEdit1.TextEdit; } }
public LabelCheckText()
{
InitializeComponent();
}
///
/// 说明:设置控件显示文本
/// 创建人:龚宇超
/// 创建日期:2017-08-07
/// 修改人:
/// 修改日期:
/// 修改备注:
/// 版本:1.0
///
/// 显示Lebel文本
public override string LabelText
{
get
{
return this.LabelTextEdit.LabelText;
}
set
{
this.LabelTextEdit.LabelText = value;
}
}
///
/// 控件值
///
/// The edit text.
public override string EditText
{
get
{
return base.EditText;
}
set
{
LabelTextEdit.EditText = value;
//TextEdit.Enabled = ckCheck.Checked = !string.IsNullOrWhiteSpace(labelAutoTextEdit1.EditText);
}
}
///
/// 只读文本颜色
///
/// The color of the read only label.
public override bool ReadOnly
{
get
{
return base.ReadOnly;
}
set
{
base.ReadOnly = value;
this.LabelTextEdit.ReadOnly = value;
}
}
///
/// 必填文本颜色
///
/// The color of the required label.
public override bool Required
{
get
{
return base.Required;
}
set
{
base.Required = value;
if (value)
{
this.LabelTextEdit.TextEdit.ForeColor = base.RequiredLabelForceColor;
}
}
}
///
/// 说明:需要单独验证是否修改
/// 创建人:龚宇超
/// 创建日期:2017-11-08
/// 修改人:
/// 修改日期:
/// 修改备注:
/// 版本:1.0
///
/// true if this instance is update; otherwise, false.
//public override bool IsUpdate()
//{
// if (this.Model.FieldType == ControlType.LabCheckAutoSeacherValue)
// {
// return !this.Model.Text.Equals(this.LabelTextEdit.EditValue, StringComparison.OrdinalIgnoreCase);
// }
// else
// {
// return base.IsUpdate();
// }
//}
///
/// 说明:选中改变状态
/// 创建人:龚宇超
/// 创建日期:2017-08-07
/// 修改人:
/// 修改日期:
/// 修改备注:
/// 版本:1.0
///
/// The source of the event.
/// The instance containing the event data.
private void ckCheck_CheckedChanged(object sender, EventArgs e)
{
try
{
CheckEdit check = sender as CheckEdit;
}
catch (Exception ex)
{
string Message = ErrorMessage.PromptErrorMessage(ex);
MessageUtil.Show(Message, ex.Message);
}
}
///
/// 背景颜色
///
/// The color of the required label.
public override Color BackgroundColor
{
get
{
return TextEdit.Properties.Appearance.BackColor;
}
set
{
TextEdit.Properties.Appearance.BackColor = value;
}
}
///
/// 前景颜色
///
/// The color of the required label.
public override Color ForeColor
{
get
{
return TextEdit.Properties.Appearance.ForeColor;
}
set
{
TextEdit.Properties.Appearance.ForeColor = value;
}
}
///
/// 内容加粗
///
/// The color of the required label.
public override bool ContentBold
{
get
{
return TextEdit.Properties.Appearance.Font.Bold;
}
set
{
Font oldFont = TextEdit.Properties.Appearance.Font;
TextEdit.Properties.Appearance.Font = new Font(oldFont.FontFamily, oldFont.Size, value ? FontStyle.Bold : FontStyle.Regular);
}
}
}
}