String to Color

Here is the C# code for dynamically assigning the color value for the control

string colorval="Red";
Color color = Color.FromName(colorval);
button1.BackColor = color; 
  
Cheers,
Venkatesan Prabu .J 
Head, KaaShiv InfoTech.
http://www.kaashivinfotech.com/
Ebook Download
View all
Learn
View all