Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / Windows Forms / WinForm General / March 2007

Tip: Looking for answers? Try searching our database.

Generic controls and resource files

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Jared - 16 Mar 2007 16:42 GMT
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
Bryan Phillips - 16 Mar 2007 21:45 GMT
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.

--
Bryan Phillips
MCSD, MCDBA, MCSE
Blog:  http://bphillips76.spaces.live.com

> 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
[quoted text clipped - 17 lines]
>
> Jared

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.