?
Solved

Inherited controls not inheriting control after rebuild

Posted on 2006-04-28
9
Medium Priority
?
308 Views
Last Modified: 2006-11-18
I have an imagelist on a parent user control. I put 5 images in the image list and then created a child user control that inherits from the parent user control. The imagelist and all 5 images were inherited in the child user control.


At some later point, I put some more images in the base class imagelist and rebuilt the project. I am expecting to see the new images in all child controls. The child controls still only show the original 5 images.

Does anyone know how I can force a refresh for all inherited controls?

Thanks!
0
Comment
Question by:gregasm
8 Comments
 
LVL 96

Expert Comment

by:Bob Learned
ID: 16566230
Now that sounds like a bug.  Inheriting controls is just plain freaky in .NET.  What .NET version are you using?  2005?

Image resources are stored in the .resx files.  Maybe renaming them will force the compiler to recreate for the inheriting forms.

Bob
0
 
LVL 8

Author Comment

by:gregasm
ID: 16567047
Hi Bob,

I was able to get the inherited image lists to refresh once by cutting the base imagelist and then immediately pasting it back in. All inherited were refreshed.

I can't get it to work again like that.

I went to a child control, and deleted the resx file, made a slight change to the child control, and recompiled. The new resx was created, but the inherited imagelist still does not have all the images.

HMM... DOH. I do not want to break up my little inheritance hierarchy with workarounds unless I absolutely have to... Someone else must have seen this before...
0
 
LVL 8

Author Comment

by:gregasm
ID: 16570274
This was for VS2003... I hope I am like many other developers who are still waiting for the right time to switch to 2005. I am in the middle of a major project still using 2003 and switching to 2005 before stabilizing and deploying it seems like a big mistake.

OK, well, anyway, here is the workaround.

In the base class, I copied the original image list to the same form, and it got assigned a new name. I recompiled, making sure the new imagelist was available to all the inheriting forms. It was.

Then I deleted the original imagelist from the base class, and renamed the new one to the name of hte old one and recompiled again.

All the child forms now have the updated imagelist.

Please close.
0
What is SQL Server and how does it work?

The purpose of this paper is to provide you background on SQL Server. It’s your self-study guide for learning fundamentals. It includes both the history of SQL and its technical basics. Concepts and definitions will form the solid foundation of your future DBA expertise.

 
LVL 11

Expert Comment

by:anyoneis
ID: 16675363
Since you answered it yourself, what is the answer? I have run into this with VS2005, and the way I get around it is to open the child control in a designer window, and then rebuild the solution.

David
0
 
LVL 8

Author Comment

by:gregasm
ID: 16676885
anyoneis, just read the thread... you will find the workaround in a previous post.
0
 
LVL 11

Expert Comment

by:anyoneis
ID: 16677787
Oh, *that* workaround. I was hoping you came up with something that was less work! My guess is that this problem will not be rectified when you move to 2005.

David
0
 
LVL 8

Author Comment

by:gregasm
ID: 16678134
lol :)
0
 

Accepted Solution

by:
GranMod earned 0 total points
ID: 16697309
Closed, 500 points refunded.
GranMod
The Experts Exchange
Community Support Moderator of all Ages
0

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

It seems a simple enough task, yet I see repeated questions asking how to do it: how to pass data between two forms. In this article, I will show you the different mechanisms available for you to do just that. This article is directed towards the .N…
In real business world data are crucial and sometimes data are shared among different information systems. Hence, an agreeable file transfer protocol need to be established.
this video summaries big data hadoop online training demo (http://onlineitguru.com/big-data-hadoop-online-training-placement.html) , and covers basics in big data hadoop .
Despite its rising prevalence in the business world, "the cloud" is still misunderstood. Some companies still believe common misconceptions about lack of security in cloud solutions and many misuses of cloud storage options still occur every day. …
Suggested Courses

850 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question