SET COLOR PROBLEM

Hi All,

I have a class to set dgv color.

dgv.RowHeadersDefaultCellStyle.SelectionForeColor = Color.White

I get compile error :

Error      1      'Color' is not declared. It may be inaccessible due to its protection level.       

What's wrong ?

Thank you.
LVL 1
emi_sastraAsked:
Who is Participating?
 
käµfm³d 👽Connect With a Mentor Commented:
Do you have a reference to System.Drawing.dll in your project?
0
 
brendanmeyerCommented:
have you got the
System.Drawing
namespace included?
0
 
käµfm³d 👽Commented:
Add:

Imports System.Drawing

...to the top of your code file.
0
 
emi_sastraAuthor Commented:
Hi All,

I've already Imports System.Drawing.

The problem still exist.

Thank you.
0
 
emi_sastraAuthor Commented:
Hi  kaufmed,

-Do you have a reference to System.Drawing.dll in your project?
No.

Now I have included and problem gone.

Thank you very much for your help.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.