Windows Forms Datagrid

rflorencio
rflorencio used Ask the Experts™
on
I need to change forecolor of datagrid rows and i use this code:

DgvDocumentos.Rows(i).DefaultCellStyle.ForeColor = Color.Red

But i need tune some colors, it´s possible use hex colors something like:

DgvDocumentos.Rows(i).DefaultCellStyle.ForeColor = Color("FFFF0000")
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
Top Expert 2015

Commented:
DgvDocumentos.Rows(i).DefaultCellStyle.ForeColor = Color.FromArgb(&HFFFF0000)
Retired
Distinguished Expert 2017
Commented:
Hi rflorencio;

No, but you can use this syntax:

DgvDocumentos.Rows(i).DefaultCellStyle.ForeColor = Color.FromArgb(255, 255, 0, 0)

Open in new window

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial