|
-
Jun 10th, 2002, 07:38 PM
#1
Thread Starter
Junior Member
.BackColor Comparison?
Hey all....
If someone comes up with the answer to this quick, I'd like to know how to search for strange problems like this in the MSDN...
A simple comparison operation. I want to perform a certain operation if a label's BackColor property is set to a certain color, ie. Color.Transparent. So logically I do the following:
label.BackColor = Color.Transparent
'.... some code ....
If (label.BackColor = Color.Transparent) Then
'...
End If
But I get an error stating that the '=' operator isn't defined by System.Drawing.Colors. This isn't making much sense. Not too sure how I can get the logic to work without some dumb workarounds if I can't compare colors. Anyone?
Regards,
Brian
-
Jun 10th, 2002, 08:08 PM
#2
Hyperactive Member
Just curious, why are you comparing a number in RGB format (or hexadecimal format depending of the control) with a boolean variable.
Anyways, that has happened to me too, except under more normal circumstances Weird.....
-
Jun 10th, 2002, 08:27 PM
#3
An RGB Color value is a Long Value. A Hexidecimal value is simply a way of representing a number. They are both the same. In the case of colors, The hex value is easier to read.
Z.
-
Jun 10th, 2002, 10:03 PM
#4
Thread Starter
Junior Member
Color.Transparent isn't a Boolean variable.... as I showed in the code, you can set the Transparent 'color' (system-defined), but you can't compare it after to see if that color took effect.
There must be some way of comparing the value of .BackColor....
Brian
-
Jun 10th, 2002, 10:05 PM
#5
Thread Starter
Junior Member
VB.NET
This is being done in VB.NET by the way... odd that I forgot to mention that before. I had no problems with this sort of operation in VB 6, but I'm aware things are a lot different in this situation.
Brian
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|