L
Lucio Menci
Hi,
I d'like to use a resource file to a class isn't a usercontrol.
If I edit the main .resx of the project, I can found that resource by the
command:
Dim WantedResource As Object = My.Resources.MyResrouceName
If I make a UserControl, VS creates three files: a.vb, a.designer.vb and
a.resx.
If I edit the a.resx and I add a resource into it, I can use that resource
from a sub of the UserControl by the sequent commands:
Dim RSManager As New Resources.ResourceManager(Me.GetType)
Dim WantedResource As Object = RSManager.GetObject("NewImage")
I tried to create a Class isn't a UserControl (b.vb), and put a new empty
file into the same directory called b.resx, create a new project, import that
Class and, if I have all files shown on the solution explorer, I see that the
b.vb have the b.resx linked. If I edit the b.resx and I add the same
resource into it, I noted that b.resx is very similar to a.resx, but if I try
to call the same commands above, the second one throws an exception
(MissingManifestResourceException). Why?
I d'like to use a resource file to a class isn't a usercontrol.
If I edit the main .resx of the project, I can found that resource by the
command:
Dim WantedResource As Object = My.Resources.MyResrouceName
If I make a UserControl, VS creates three files: a.vb, a.designer.vb and
a.resx.
If I edit the a.resx and I add a resource into it, I can use that resource
from a sub of the UserControl by the sequent commands:
Dim RSManager As New Resources.ResourceManager(Me.GetType)
Dim WantedResource As Object = RSManager.GetObject("NewImage")
I tried to create a Class isn't a UserControl (b.vb), and put a new empty
file into the same directory called b.resx, create a new project, import that
Class and, if I have all files shown on the solution explorer, I see that the
b.vb have the b.resx linked. If I edit the b.resx and I add the same
resource into it, I noted that b.resx is very similar to a.resx, but if I try
to call the same commands above, the second one throws an exception
(MissingManifestResourceException). Why?