日期:2014-05-17 浏览次数:21401 次
protected override void OnPaint(PaintEventArgs args)
{
base.OnPaint(args);
if (!Enabled)
{
args.Graphics.DrawString(Text, Font, new SolidBrush(Color.DimGray), new PointF(0.0F, 0.0F));
}
}
protected override void OnEnabledChanged(EventArgs e)
{
if (Enabled)
{
this.SetStyle(ControlStyles.UserPaint, false);
this.Font = new System.Drawing.Font(Font.FontFamily, Font.Size, Font.Style, Font.Unit);
}
else
{
this.SetStyle(ControlStyles.UserPaint, true);
}
base.OnEnabledChanged(e);
}
protected override void OnPaint(PaintEventArgs args)
{
base.OnPaint(args);
if (!Enabled)
{
StringFormat TitleFormat = new StringFormat();
if (this.TextAlign == HorizontalAlignment.Center)
{
TitleFormat.Alignment = TitleFormat.LineAlignment = StringAlignment.Center;
}
else if (this.TextAlign == HorizontalAlignment.Right)
&