473,548 Members | 2,697 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

ImageList images and name

Hi!

I'm wondering is it possible to give names for the images in the
imagelist somehow, and retrieve those images when needed by using code
like pic.Image = ImageList1.Imag es("Save") instead of pic.Image =
ImageList1.Imag es(1) ?

I'd like to retrieve images of the imagelist by name instead of image
index number because if order of those images are changed then index of
image may be no more same as referenced in the code, so name would be
better to use in this case.

I think something like this was possible to do with VB6 and earlier
versions.

--
Thanks in advance!

Mika
Nov 21 '05 #1
1 2625
Mika,

I'm not sure if you put the images in a hashtable but that is probably the
structure you are looking for. You might want to check out the hashtable
documentation @
http://msdn.microsoft.com/library/de...classtopic.asp

Curtis

"Mika M" <ma************ ***@luukku.com> wrote in message
news:ug******** ******@TK2MSFTN GP15.phx.gbl...
Hi!

I'm wondering is it possible to give names for the images in the imagelist
somehow, and retrieve those images when needed by using code like
pic.Image = ImageList1.Imag es("Save") instead of pic.Image =
ImageList1.Imag es(1) ?

I'd like to retrieve images of the imagelist by name instead of image
index number because if order of those images are changed then index of
image may be no more same as referenced in the code, so name would be
better to use in this case.

I think something like this was possible to do with VB6 and earlier
versions.

--
Thanks in advance!

Mika

Nov 21 '05 #2

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

Similar topics

4
48962
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 way to do this? This was easy to do in the old MFC. I can not find the answer in C#. I also need to embed an XML file into the resource and...
2
1655
by: sandman | last post by:
I created an ImageList in the .NET Designer. Now I can't figure out where the images are located. Where is all this stuff stored and how do I read it? (me personally, I mean -the computer is doing it just fine.) sandman *** Sent via Developersdex http://www.developersdex.com *** Don't just participate in USENET...get rewarded for it!
2
3156
by: A. Solomon | last post by:
Hi, I have a ImageList containing 4 bitmaps attached to a UserControl which acts as a Open/Close panel. This panel, upon click, switches the image in a PictureBox control to indicate the current panel status (Open/Close). Problem is that in certain complex scenarios the images disappear! from the ImageList. That is, when I call:...
2
8509
by: Sanjeeva Reddy | last post by:
hai Anti Keskinen, i have used the following code MyListView->LargeImageList->ImageSize = gcnew System::Drawing::Size(100, 100); // Sets large image size to 100, 100 here i am getting error like "gcnew is undeclared error",how to deeclare 'gcnew" and when i am using in runtime to change the size of images in imagelist in listview control...
6
1407
by: Stephen Costanzo | last post by:
In the code below I receive an exception error because the target file is being used by another process. I know this to be false because the target doesn't exist. It seems like the application believes that the file is still in use by the application. My concern is that I do not think that I still have a reference to it. In the removeImage...
7
2089
by: Andrew Christiansen | last post by:
Hey everyone. I have Visual Basic .NET 2003 and am trying to show images on a treeview control. I have the imagelist on the form filled with images, and have the ImageList property of the treeview control set to the imagelist containing the images I want to be displayed next to each node. It seems that no matter what I do there will be no...
4
2185
by: Just Me | last post by:
If I add an image to an imagelist using imageList.Images.Add... And use it with a tree node tn.ImageIndex = imageList.Images.Count-1 This is the actual code: Win32.Shell.SHGetFileInfo(NodePath, 256, fileinfo, cbFileInfo, flags) tvFolders.ImageList.Images.Add(Icon.FromHandle(fileinfo.hIcon)) tn.ImageIndex = tvFolders.ImageList.Images.Count...
0
2828
by: Andre Viens | last post by:
Hello, I am using the following variation of code from <http://support.microsoft.com/default.aspx?scid=kb;EN-US;319340> to add icons to an imagelist for use in a listview: Private Structure SHFILEINFO Public hIcon As IntPtr ' : icon Public iIcon As Integer ' : icondex Public dwAttributes As Integer ' : SFGAO_ flags
2
3546
by: =?Utf-8?B?S2VuTg==?= | last post by:
We're using a System.Windows.Forms.ImageList to store a bunch of Images that I've loaded, and rendering each image in the ImageList during a draw loop. The process was running unusually slow and was causing memory spikes. After several hours we discovered that the ImageList.Images indexer is actually returning a copy of the added Images...
0
7518
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
0
7954
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
0
7805
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
0
6039
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
1
5367
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
3497
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
0
3478
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
1932
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
1
1054
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.