Generic controls and resource files

J

Jared

I'm trying to utilize a resource file with my generic control class, but an
exception is thrown when I attempt to load the resource file, stating that
the file doesn't exist.

Since a control utilizing a generic class cannot be opened in the designer,
I had previously created the control without the generic and created a
resource file for it. But if I add the generic portion of the class, it
fails to find the file.

Is there a way to get a resource file from a class that has a generic type
(ie: class myclass<T>:Control)? or is there another way to access the
resources?


Currently using the following code to apply resources:
System.ComponentModel.ComponentResourceManager resources = new
System.ComponentModel.ComponentResourceManager(typeof(ResizableLabeledCombo<T>));
resources.ApplyResources(this.m_combo, "m_combo");



Thanks.

Jared
 
B

Bryan Phillips

Create a custom control and see what changes it makes to the resx and
project file so that you can do the same for your generic class.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top