Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

How to compare colors in IF statement

103 views
Skip to first unread message

George Padvorac

unread,
May 28, 2003, 9:13:21 AM5/28/03
to
I need to determin if a color is a spefic color like:

IF obj.backcolor = color.red then

but this gets a compile error saying:

Operator '=' is not defined for types 'System.Drawing.Color' and
'System.Drawing.Color'.

how can I determin if obj.backcolor is actually color.red?

Thanks.

--
George Padvorac
geo...@dontspamme-nwis.net


Ken Tucker

unread,
May 28, 2003, 9:22:20 AM5/28/03
to
George,

Dim clr As Color

clr = Me.BackColor

Dim bEqual As Boolean = clr.Equals(Color.Red)

Ken

-------------------

"George Padvorac" <geo...@nwis.net> wrote in message
news:OyMgsrRJ...@TK2MSFTNGP11.phx.gbl...

George Padvorac

unread,
May 28, 2003, 5:07:42 PM5/28/03
to
Thanks that worked great.

--
George Padvorac
geo...@dontspamme-nwis.net

"Ken Tucker" <vb...@bellsouth.net> wrote in message
news:ONOvZwRJ...@TK2MSFTNGP11.phx.gbl...

0 new messages