PC Review Forums Newsgroups Microsoft DotNet Microsoft Dot NET Framework Forms ImageList in base class not working correctly in inherited class

Reply

ImageList in base class not working correctly in inherited class

 
Thread Tools Rate Thread
Old 13-12-2005, 02:07 PM   #1
=?Utf-8?B?QnJ1Y2UgUGFya2Vy?=
Guest
 
Posts: n/a
Default ImageList in base class not working correctly in inherited class


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?
  Reply With Quote
Old 14-12-2005, 03:13 AM   #2
Kevin Yu [MSFT]
Guest
 
Posts: n/a
Default RE: ImageList in base class not working correctly in inherited class

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."

  Reply With Quote
Old 15-12-2005, 01:38 PM   #3
=?Utf-8?B?QnJ1Y2UgUGFya2Vy?=
Guest
 
Posts: n/a
Default RE: ImageList in base class not working correctly in inherited cla

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

  Reply With Quote
Old 16-12-2005, 02:20 AM   #4
Jeffrey Tan[MSFT]
Guest
 
Posts: n/a
Default RE: ImageList in base class not working correctly in inherited cla

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.

  Reply With Quote
Reply



Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off