The generated code is wrong. "Yes" must have been a function, not a
property. A property indicates that each time the same image is returned. In
fact, a new Image is created every time. Therefore, comparing the image in
the Control to the new Image from the ressource, will always return False.
Remember which image you assigned in a separate variable.
Armin
It's got the property icon. What's more, it's generated automatically
from the properties page for the project. (The resources tab - each
resource gets a name under My.Resources.<auto_generated>). I
understand what your saying about the references not lining up because
it's not the same instance of the object.
However, it's basically flat out impossible for me to store the
original image description in a seperate variable. This is some of the
most complex code I've written and it's well tested so I can't afford
to change it and get it wrong. I don't want to get into the symantecs
of what the code does or whether it's good coding but basically I
cannot modify the code in the way you have suggested, which is a
shame.
However, let me explain what I'm trying to do. I have a user control I
wrote myself. When it is disabled, the images within the control do
not change. They still look colourful like this could be clicked on.
What I'm really going for is to have my controls OnEnabledChanged
value toggle between colourful and "Greyscale" style images but I
cannot compare the image to it's original value. Can anyone help
please?