Code:
public partial class Form1 : Form { Button btn; TextBox txt; public Form1() { InitializeComponent(); //a textbox txt = new TextBox(); Controls.Add(txt); //a button to change
public partial class Form1 : Form { Button btn; TextBox txt; public Form1() { InitializeComponent(); //a textbox txt = new TextBox(); Controls.Add(txt); //a button to change
e.Graphics.FillRectangle(new SolidBrush(BackColor)
public Form1() { InitializeComponent(); this.DoubleBuffered = true; } protected override void OnPaint(PaintEventArgs e) { e.Graphics.FillRectangle(new SolidBrush(BackColor), 0, 0, 50, 50); base.OnPaint(e); }
Leave a comment: