wetallday
wetallday

Reputation: 31

I cannot use the Color.FromName(string s) method

I need to use the FromName Method, but for some reason it is not available. I have been googling for a while but I cannot find a solution.

enter image description here

Upvotes: 1

Views: 2899

Answers (2)

DevNow
DevNow

Reputation: 71

I thinks you also have a reference to System.Windows.Media, hence the IDE is trying to refer to its Color class methods.

Try var c = System.Drawing.Color.FromName("colorname");

Upvotes: 2

Arthur Attout
Arthur Attout

Reputation: 2916

Try using System.Drawing.Color.FromName instead of Color.FromName. If that doesn't help, maybe the problem comes from the Framework, which is quite unlikely ..

Upvotes: 0

Related Questions