Note
Access to this page requires authorization. You can try signing in or changing directories.
Access to this page requires authorization. You can try changing directories.
This example changes the background color of a Windows Form programmatically.
Example
private void Form1_Click(object sender, EventArgs e)
{
this.BackColor = System.Drawing.Color.DarkBlue;
}
Compiling the Code
This example requires:
- A form named Form1. Set its Click event handler to Form1_Click.
See Also
Concepts
Designing a User Interface in Visual C#