How to change back color of UserControl that equal date today.

Jay-R Hayashi 166 Reputation points

User's image

Good day, I created a calendar but I don't know how to change the back color of User Control which equal to day today.

A set of technologies in the .NET Framework for building web applications and XML web services.
3,787 questions
Visual Studio
Visual Studio
A family of Microsoft suites of integrated development tools for building applications for Windows, the web and mobile devices.
4,115 questions
SQL Server
SQL Server
A family of Microsoft relational database management and analysis systems for e-commerce, line-of-business, and data warehousing solutions.
11,635 questions
An object-oriented and type-safe programming language that has its roots in the C family of languages and includes support for component-oriented programming.
9,501 questions
A high-level, general-purpose programming language, created as an extension of the C programming language, that has object-oriented, generic, and functional features in addition to facilities for low-level memory manipulation.
3,327 questions
{count} votes

Accepted answer
  1. Viorel 106.5K Reputation points

    For example, try adding this line inside the second loop:

    if( i == now.Day ) ucdays.BackColor = Color.Red;

    You can also add a bool or DateTime parameter to the days function, and adjust all of appearance inside the function.

    1 person found this answer helpful.

0 additional answers

Sort by: Most helpful