RSManager.GetObject
(1)
Resources.ResourceManager
(1)
RSManager
(1)
WantedResource
(1)
UserControl
(1)
NewImage
(1)
Directory
(1)
Resx
(1)

Resources on Classes

Asked By Lucio Menci
13-Nov-09 06:49 AM
Hi,

I d'like to use a resource file to a class is not 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 create 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 is not 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 connected. 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?

Sorry, I wrote in a wrong discussion...

Lucio Menci replied to Lucio Menci
13-Nov-09 09:20 AM
Sorry, I wrote in a wrong discussion...
Post Question To EggHeadCafe