Hey,
I'm creating an class library in wich I have a resource file that contains an image that is going to be used as a backgroundImage of a custom control (Button).
So in the Sub New() of my custom Button I added:
Me.BackgroundImage = My.Resources.Resources.customImage
When I drag the control on a form in my class library the backgroundImage property doesn't hold a reference to the image in the resource file but instead created an local resource (formName.resx) and replaced the property with System.Drawing.Image.
Now when I change the property of the control manualy to use the Resources.resx file and the customImage element in that resource. For some reason everything seems to work like a charm.
Why on earth would visual studio change my code (where I refer to a resource file) to an local resource.
Offcourse this would make me completly lose the advantage of resource files because when changes are made to any of the images I would have to replace them in all the local resource files.
Anyone an idea what is going on or how I am able to prevent this from happening.
Thanks in advance
I'm creating an class library in wich I have a resource file that contains an image that is going to be used as a backgroundImage of a custom control (Button).
So in the Sub New() of my custom Button I added:
Me.BackgroundImage = My.Resources.Resources.customImage
When I drag the control on a form in my class library the backgroundImage property doesn't hold a reference to the image in the resource file but instead created an local resource (formName.resx) and replaced the property with System.Drawing.Image.
Now when I change the property of the control manualy to use the Resources.resx file and the customImage element in that resource. For some reason everything seems to work like a charm.
Why on earth would visual studio change my code (where I refer to a resource file) to an local resource.
Offcourse this would make me completly lose the advantage of resource files because when changes are made to any of the images I would have to replace them in all the local resource files.
Anyone an idea what is going on or how I am able to prevent this from happening.
Thanks in advance