PC Review
Forums
Newsgroups
Microsoft DotNet
Microsoft Dot NET Framework Forms
ImageList in base class not working correctly in inherited class
Forums
Newsgroups
Microsoft DotNet
Microsoft Dot NET Framework Forms
ImageList in base class not working correctly in inherited class
![]() |
ImageList in base class not working correctly in inherited class |
|
|
Thread Tools | Rate Thread |
|
|
#1 |
|
Guest
Posts: n/a
|
I have created a ImageList instance in a base class that inherits from
usercontrol. I next created a class that inherits from this base class that contains a toolbar control that uses the ImageList. From this class I have created several different classes that inherit from this class and adds the toolbar as a control. When you put one of these inherited classes in design mode, the imagelist is being copied into the inherited class. This is causing the toolbar to not display properly. Removing the code fixes the problem. What is happening? |
|
|
|
#2 |
|
Guest
Posts: n/a
|
Hi,
We have reviewed this issue and are currently researching on it. We will update you ASAP. Thanks for your patience! Kevin Yu ======= "This posting is provided "AS IS" with no warranties, and confers no rights." |
|
|
|
#3 |
|
Guest
Posts: n/a
|
Here is what I did:
I created a base class that is a user control (inherits from usercontrol). I dragged an ImageList from the toolbox onto the designer form. Added my images. Changed the friend attribute on the imagelist to public. I next created another class that inherits from this base class. In this class I created a toolbar instance. I added the imagelist to the imagelist property of the toolbar. I created another class that inherits from this class. I manually add the toolbar the controls collection. Flipping to design mode on this class causes the imagelist to be automatically duplicated. I have currently abandoned this approach because of this problem. ""Jeffrey Tan[MSFT]"" wrote: > Hi, > > Thanks for your post. > > I have some questions regarding your issue, I hope you can clarify them, > then we can understand the scenario much better, thanks: > 1. "When you put one of these inherited classes in design mode" > Does the "design mode" mean inherited usercontrol in its own designer, or > just drop it on the form designer? > 2. "the imagelist is being copied into the inherited class" > What does this mean? Is your imagelist created manually by code or you just > drag it to the base UserControl from toolbox? Normally, we can drag the > imagelist from toolbox in base usercontrol, it will have private modifier, > then we can not access it in inherited class. So, to use it in inherited > usercontrol, we must change its modifier to public/protected, first. Then > the imagelist will appear in the inherited usercontrol's visual root > designer(in component tray). > > Currently, I have created a sample project follow your instruction, > however, I did not see anything wrong with the project.(You can get it with > Outlook Express, not IE) > > I will wait for your further feedback. Thanks > > Best regards, > Jeffrey Tan > Microsoft Online Partner Support > Get Secure! - www.microsoft.com/security > This posting is provided "as is" with no warranties and confers no rights |
|
|
|
#4 |
|
Guest
Posts: n/a
|
Hi,
Thanks for your feedback. Currently, I am still can not reproduce out your problem on my side. Anyway, I see that you have abandoned this approach. If you need further help, please feel free to post. Thanks Best regards, Jeffrey Tan Microsoft Online Partner Support Get Secure! - www.microsoft.com/security This posting is provided "as is" with no warranties and confers no rights. |
|
![]() |
|
| Thread Tools | |
| Rate This Thread | |
|
|

Main Page 

