class starbutton : UserControl
{
[Bindable(true)]
[EditorBrowsable(EditorBrowsableState.Always)]
[Browsable(false)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Visible)]
public override string Text { get { return base.Text; } set { base.Text = value; this.Invalidate(); } }
protected override void OnPaint(PaintEventArgs e)
{
Graphics graphics = e.Graphics;
SolidBrush brush2 = new SolidBrush(Color.Green);
Point[] points =
{
new Point(ClientSize.Width / 2, 0),
new Point(0, ClientSize.Height/4),
new Point(0, ClientSize.Height),
new Point(ClientSize.Width, ClientSize.Height)
};
graphics.FillPolygon(brush2, points);
base.OnPaint(e);
}
}
I created a user control to create a button using shapes. I managed to do this, but I added a property so that it can display text on the form, but not display text. Why doesn't he show the text?

source
share