Generic controls and resource files

  • Thread starter Thread starter Jared
  • Start date Start date
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
 
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.
 
Back
Top