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;namespace WindowsFormsControlLibrary1 { public partial class UserControl1 : UserControl { public UserControl1() { InitializeComponent(); } String _ButtonText = String.Empty;
[Browsable(true)] public String ButtonText { get { return _ButtonText; } set { _ButtonText = value; this.Invalidate(); } } protected override void OnPaint(PaintEventArgs e) { base.OnPaint(e); e.Graphics.DrawString(this._ButtonText, this.Font, new SolidBrush(this.ForeColor), new PointF(0, 0)); } } }
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
using System.Data;
using System.Linq;
using System.Text;
using System.Windows.Forms;namespace WindowsFormsControlLibrary1
{
public partial class UserControl1 : UserControl
{
public UserControl1()
{
InitializeComponent();
} String _ButtonText = String.Empty;
[Browsable(true)]
public String ButtonText
{
get
{
return _ButtonText;
} set
{
_ButtonText = value;
this.Invalidate();
}
} protected override void OnPaint(PaintEventArgs e)
{
base.OnPaint(e); e.Graphics.DrawString(this._ButtonText, this.Font,
new SolidBrush(this.ForeColor), new PointF(0, 0));
}
}
}