Check if Background color is empty

T

tshad

I have tried all kinds of combination to test for an empty color. I have
set a datagriditems background color to some color and need to later loop
through all the items to find the one that is not empty and to set it to
empty.

This one:

if oDGI.BackColor <> Color.Empty then

gives me:

Compiler Error Message: BC30452: Operator '<>' is not defined for types
'System.Drawing.Color' and 'System.Drawing.Color'.

Source Error:

Line 696: for each oDGI as DataGridItem in oGrid.Items
Line 697: trace.warn("oDGI = " & oDGI.BackColor.ToString())
Line 698: if oDGI.BackColor <> Color.Empty then

How do I test for it and how do I set it to empty?

I am setting to a color by:

oDGI.BackColor = System.Drawing.Color.Green

Thanks,

Tom
 
T

tshad

tshad said:
I have tried all kinds of combination to test for an empty color. I have
set a datagriditems background color to some color and need to later loop
through all the items to find the one that is not empty and to set it to
empty.

I got it.

if oDGI.BackColor.Equals(Color.Green) then

Tom
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,483
Members
44,901
Latest member
Noble71S45

Latest Threads

Top