It won't let you because Color is a structure, which is a value type, and Is is an operator reserved for comparing reference types to see if they point at the same object.
If that doesn't make sense, you need to look up value and reference types, and structures as well.
However, luckily for you, a color variable gets initialised to the value Color.Empty.
So you might think that you can do
But although I agree that would be the most obvious choice, you have to use the Equals method of the color structure. You can either do it one of the three following ways - it does not make any difference (though the fact that you can do it three ways does add to the confusion - just pick the way that is most natural for you)
Code:
If Color.Equals(Color.Empty, Color1)...
If Color1.Equals(Color.Empty) Then...
If Color.Empty.Equals(Color1) Then...
In other languages like Java, the class designer can change what = and other operators mean. I don't think this is yet possible in .net, which is presumably why you have to use the Equals method.
Hope this helps
Mark
![[openup] [openup] [openup]](/data/assets/smilies/openup.gif)