• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 320
  • Last Modified:

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.
0
emi_sastra
Asked:
emi_sastra
  • 2
  • 2
1 Solution
 
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
 
käµfm³d 👽Commented:
Do you have a reference to System.Drawing.dll in your project?
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

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

  • 2
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now