473,411 Members | 2,272 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,411 software developers and data experts.

class inherited, what about its resources(particually imageList)

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
May 19 '07 #1
3 1486
On May 19, 9:45 am, "Ryan Liu" <RyanLi...@gmail.comwrote:
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

May 19 '07 #2
On Fri, 18 May 2007 23:45:40 -0700, Ryan Liu <Ry*******@gmail.comwrote:
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
May 19 '07 #3
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
"Peter Duniho" <Np*********@nnowslpianmk.comwrote in message
news:op***************@petes-computer.local...
On Fri, 18 May 2007 23:45:40 -0700, Ryan Liu <Ry*******@gmail.comwrote:
>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

May 20 '07 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: Ed Sutton | last post by:
I have been searching for how to get an icon resource and load it into an ImageList. I added an *.ico file to my project and set the files "Build Action" to "Embedded Resource". Is there any easy...
4
by: Chuck | last post by:
When ever I try to implement an ImageList, I always get an exception when the application runs. The ImageList doesn't even have to be used by anything. An empty ImageList doesn't throw! The...
1
by: paradox | last post by:
I want to have a TreeView that shows an image on some items, but not all. Basically, if a certain condition is true, a caution icon is placed next to the treeview item. The problem is that, by...
0
by: Jac | last post by:
Hey, I have following code : In InitializeComponent : this.mComponents = new System.ComponentModel.Container(); System.Resources.ResourceManager resources = new...
6
by: henrycortezwu | last post by:
Hi, I have a WinXPSP2, P4 3.2GHZ, 1GIG RAM on my dev machine using VS2005 VB.NET. I did the following procedure: 1. Added 82 icons (128x128 in size & 32bit Depth) in an imagelist control 2....
6
by: [Joe] | last post by:
Hi, How can I get the System class ImageList from C# application, I want to receive this image list used in device manager ? I find a C API : WINSETUPAPI BOOL WINAPI SetupDiGetClassImageList(...
0
by: gene kelley | last post by:
(using VS2005) I want to add an icon to TreeView nodes. 1) To a new project (VB or C#) I add a sample TreeView with some sample nodes. I add an ImageList component, and add one icon image. I...
1
by: Diego F. | last post by:
Hi again. Is it possible to insert an image in a ImageList object in a specific position? Something like ImageList1.Images = Image I mean, any kind of InsertAtPostition method for...
10
by: Paul E Collins | last post by:
I want to fill an ImageList with bitmaps for a ListView from another thread, because it's a time-consuming process. I expect the ListViewItems' images to "load" one by one, as in a Web browser. ...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.