How to Convert from 'System.Drawing.Color' to 'System.Drawing.Brush' ?
This cast does not work.
(Brush)colorDialog1.Color;
I have a color dialog, and I need to pick the color from it and use as Brush color
How to Convert from 'System.Drawing.Color' to 'System.Drawing.Brush' ?
This cast does not work.
(Brush)colorDialog1.Color;
I have a color dialog, and I need to pick the color from it and use as Brush color
You have to choose a specific type of Brush, most common is SolidBrush:
using (Brush brush = new SolidBrush(colorDialog1.Color))
{
// perform operations
}
See http://msdn.microsoft.com/en-us/library/aa983677(v=vs.71).aspx for a list of available brushes.