Files
lserp_cs_6.0/插件库/Lskj.Control/LabelTitle.cs
cyf ab56a9bcf7 基线 SVN r240
SVN-Revision: r240
2025-02-06 06:46:06 +00:00

80 lines
2.0 KiB
C#

using Lskj.Control;
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 LabelTitle : BaseUserControl
{
public LabelTitle()
{
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 override string LabelText
{
get
{
return this.lblText.Text;
}
set
{
this.lblText.Text = value;
if (FontSize > 0)
{
this.lblText.AutoSize = false;
this.lblText.Dock = System.Windows.Forms.DockStyle.Fill;
this.lblText.Location = new System.Drawing.Point(0, 0);
this.lblText.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
this.lblText.Font = new Font(this.lblText.Font, FontStyle.Bold); // 设置字体为粗体
}
}
}
/// <summary>
/// 字体大小
/// </summary>
/// <value>The size of the control.</value>
public override float FontSize
{
get
{
return base.FontSize;
}
set
{
base.FontSize = value;
if (value > 0)
{
this.lblText.Font = new Font(this.lblText.Font.FontFamily, value, FontStyle.Bold);
}
}
}
}
}