Dennis,
Did you try the Equals function or the Equals Operator?
If mycolor.Equals(Color.Empty) Then
End If
To use the Equals Operator you need to call the shared function that is
created.
If Color.op_Equality(mycolor, Color.Empty) Then
End If
See the Color.Equals function in the online help for some important remarks
about using Color.Equals and when you may want to use Color.ToArgb to
compare two colors.
If mycolor.ToArgb() = Color.Empty.ToArgb() Then
End If
NOTE: VS.NET 2005 (aka Whidbey, due out later in 2005) will support calling
the Equals Operator with the familiar "=" syntax. For information on VS.NET
2005 see
http://lab.msdn.microsoft.com/vs2005/.
' VS.NET 2005 sample
If mycolor = Color.Empty Then
End If
Hope this helps
Jay
"Dennis" <(E-Mail Removed)> wrote in message
news:9A638870-CBE0-47D8-A453-(E-Mail Removed)...
>I have a public variable in a class of type color declared as follows:
>
> public mycolor as color = color.Empty
>
> I want to check to see if the user has specified a color like;
>
> if mycolor = Color.Empty then.....
> or
> if mycolor is Color.Empty then .......
>
> I get errors saying that = can be used for colors and is can't be used
> with
> value types. I give up...how do I do this. Thanks.
> --
> Dennis in Houston