C# Windows Form

Change Label Background color Programmatically in C# Windows Form

Label server control’s BackColor property get or set the background color of label control. the BackColor property value type is System.Drawing.Color.

This ‘Color‘ represents the background color of label control.

We can simply input any valid color name for BackColor property value such as Magenta, Yellow, Pink etc.

We need to import the System.Drawing namespace to apply label background color programmatically.

The following c# example code demonstrate us how can we apply label background color dynamically at run time in a C# Windws Form Application.

C# Code:

 

Output:

Leave a Comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.