Tag Archives: Random Colors in C#

How to add rows and columns to a WPF Grid programmatically

Introduction In this post we will see how to add rows and columns to a Grid in WPF programmatically using code behind. After adding rows and columns to the Grid, we will add some Buttons to it. We will set background of these buttons to random colors using RandomColor class created in my last article… Read More »

How to generate random colors in C#

Introduction In an application I required to generate some random colors. Writing these colors manually was not easy. So I decided to use .NET Reflection to generate colors using System.Drawing.Color class Description We can use GetProperties method of Type class to get all the properties of Color class. It returns an array of PropertyInfo class.… Read More »