class inherited, what about its resources(particually imageList)

R

Ryan Liu

Hi,

If I extend a user control, do I need to so something for its resource file,
like ImageList used in parent class?

I ask this question because I often get inconsistent problem with images on
a toolbar button.

Thanks a lot!
Ryan
 
M

Moty Michaely

Hi,

If I extend a user control, do I need to so something for its resource file,
like ImageList used in parent class?

I ask this question because I often get inconsistent problem with images on
a toolbar button.

Thanks a lot!
Ryan

Hi,

As I can see it, there is no reason to discard the resources. Since a
new instance of the subclass creates a new instance of the superclass
(as it was non inherited class) the subclass can access all its
superclass protected and public stuff.

I haven't tried it, but that's how my logic works :)

Moty
 
P

Peter Duniho

If I extend a user control, do I need to so something for its resource
file, like ImageList used in parent class?

Not unless you decide you want to change the way that ImageList (for
example) is used.

I assume this is related to your previous question. There's nothing in
either of your posts that point to an obvious problem. I can confirm for
you that you shouldn't have trouble with your button images showing
sometimes and not other times. I can't say for sure that it's a bug in
your own code, but that does also seem likely.

If you can post a concise, complete example of code that reliably
reproduces the problem, someone here may be able to look at it and tell
you what's wrong with it.

Pete
 
R

Ryan Liu

Thanks, Pete!

I write a small test application, but I couldn't reproduce the problem.

Maybe because my original application is somehow corrupted, I guess what I
can do is rewrite all code and let Visual Studio to regenerate the necessary
code(InitializeComponent) and resx files.

Thanks a lot!
Ryan
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top