Windows Develop Bookmark and Share   
 index > Windows Forms Designer > Designer Capable ImageList that uses the Resources...
 

Designer Capable ImageList that uses the Resources...

Okay,

Call me crazy, but I put a BindingNavigator on the Form and it adds images to the Form1.resx file.
I Then Want to use the Disk image for a different button, so I have to add a Disk Image to the Resources (embedded or linked doesn't matter) and attach it to my button.
I then want to have an Expanded list view with open and closing folders so I put an Image List on the Form which opens multiple image files, and then stores them in an ImageLIstStream encoded resource in the Form1.resx.

That's TOO MANY LOCATIONS. (what idiot designed it this way)

If any component is to use the Resources to gather information it should do it the same way EVERY TIME. Therefore my form gives me true WYSIWYG appearance with all my images and such, but the Resources are available to that All my forms can use them. Some times forms have need of the same icons, and the size of the exe just keeps gettin' larger because we have the same icons 4 times over in the program.

I want one resource image to be used no matter how many times I use that Image. Whether it be in an ImageList, a Button Image, or ON the BInding Navigator. I don't care. but!!! I Do want it to be visible and accessible through the designer. SO when I go to Choose Images on the ImageList it affords me the choice of selecting them from the Local Resources, and/or when I add a file to the ImageList, it doesn't put it some wacked location that can never be used again, but puts it in the Local Resources.

Is this too much to ask? Anyone know of some third party components that do just this so I can move away from poorly designed interfaces?
Thanks
Jaeden "Sifo Dyas" al'Raec Ruiner


"Never Trust a computer. Your brain is smarter than any micro-chip."
JaedenRuiner  Thursday, April 09, 2009 8:17 PM
Hi JaedenRuiner,

I understand your feeling. Most of the time, when I am faced a problem which is by design, I will feel unhappy like you. However, the most important thing is to find workaround for this.

Regarding to your concern, I think you can first add the image resources to the Form1.resx. Then you can use them across all your forms regardless it's using by ImageList, a Button Image, or something else.

Take ImageList for example:

We can easy add a picture which has been already added to the resource by the code in the following line.

this.imageList1.Images.Add(Properties.Resources.ImageName);

When you add resources through the Resource adding dialog, the designer will generate the corresponding type for each resource. So you can take advantage of the intellisense.

Any way, you can aslo feedback in the Microsoft Connect Portal . Engineers there will take your feedback seriously into consideration when they plan the next version of our products.


Best regards,
Bruce Zhou
Please mark the replies as answers if they help and unmark if they don't.
Bruce.Zhou  Monday, April 13, 2009 7:53 AM
We can easy add a picture which has been already added to the resource by the code in the following line.
this.imageList1.Images.Add(Properties.Resources.ImageName);
This I knew about already, but A) I cannot add those lines into the Designer as the Designer complains violently about not know what the Add or AddRange method for the ImageList is. The Designer can only use the ImageStream() property. Thus even though I can add the Images to the IMageList, doing it this way defeats the purpose of a "forms designer" as I cannot see what I've designed as I've designed it. It is better in this manner to export all the BindingNavigator Icons, and then re-import them into the ImageList so that the IMageList is the only repository of the images. My issue was pointing out not that there aren't enough ways to utilize the IMageList, but that the RAD method built into these components is designed to double, tripple, or even quadruple your resources size, which indicates poor planning...no, i don't think that is right, intentional crappy design. I can't believe nobody ever noticed this even once, which causes the only deduction it was intentional.
Any way, you can aslo feedback in the Microsoft Connect Portal . Engineers there will take your feedback seriously into consideration when they plan the next version of our products.
A lot of good that would. This design has been in since 2.0 or before. THe ImageList has never used the base resources for the images it has always requested the images come from the harddrive, and then created its own image stream. In addition, fixing it for the next version isn't going to help much, because I'd have to not only overhaul everything to work on .Net 4.0 but using 2008 i'm on a 3.5 IDE so i'd have to upgrade that as well.
*shrug*

Thanks anyway.
J"SD"a'RR



"Never Trust a computer. Your brain is smarter than any micro-chip."
JaedenRuiner  Monday, April 13, 2009 1:10 PM

You can use google to search for other answers

Custom Search

More Threads

• Form designer does not handle Generic List properties of custom controls... ???
• Window Form Designer Sub Properties GUI Problem?
• How can I Extend Child Controls of an Extended Control
• Looking for simple threading example
• My class in the property grid
• Continuous Forms
• how can we have Image and corresponding text in ListBox
• Properties bar doesn't work
• How to make linklabel control work fine properly ?
• ClipControls in .NET