c# - How convert Drawing.Color to Drawing.Brush, Windows Forms -


this question has answer here:

how convert 'system.drawing.color' 'system.drawing.brush' ?

this cast not work.

(brush)colordialog1.color; 

i have color dialog, , need pick color , use brush color

you have choose specific type of brush, common solidbrush:

using (brush brush = new solidbrush(colordialog1.color)) {     // perform operations } 

see http://msdn.microsoft.com/en-us/library/aa983677(v=vs.71).aspx list of available brushes.


Comments

Popular posts from this blog

javascript - Jquery show_hide, what to add in order to make the page scroll to the bottom of the hidden field once button is clicked -

javascript - Highcharts multi-color line -

javascript - Enter key does not work in search box -