473,473 Members | 4,176 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

referring to imagelists

How can I refer to the imagelists in a form? Something along the lines of:

dim imglist as Imagelist
For Each imglist in Me.Imagelists <----- except this doesn't exist

Thanks in advance,

Doug
Mar 4 '07 #1
6 1106
Hello Doug,

It works like this:

Dim c As Control
Dim imgL As ImageList

For Each c In Me.Controls
If TypeOf c is ImageList Then
imgL = CType(c, ImageList)
'... Your code here ...
End If
Next

Best regards,

Martin

Doug Glancy wrote:
How can I refer to the imagelists in a form? Something along the lines of:

dim imglist as Imagelist
For Each imglist in Me.Imagelists <----- except this doesn't exist

Thanks in advance,

Doug

Mar 4 '07 #2
"Martin H." <hk***@gmx.netschrieb:
It works like this:

Dim c As Control
Dim imgL As ImageList

For Each c In Me.Controls
If TypeOf c is ImageList Then
imgL = CType(c, ImageList)
'... Your code here ...
End If
Next
Are you sure this works? ImageList is a component, not a control class.

--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://classicvb.org/petition/>
Mar 4 '07 #3
"Herfried K. Wagner [MVP]" <hi***************@gmx.atwrote in message
news:Os**************@TK2MSFTNGP03.phx.gbl...
"Martin H." <hk***@gmx.netschrieb:
>It works like this:

Dim c As Control
Dim imgL As ImageList

For Each c In Me.Controls
If TypeOf c is ImageList Then
imgL = CType(c, ImageList)
'... Your code here ...
End If
Next

Are you sure this works? ImageList is a component, not a control class.

--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://classicvb.org/petition/>
Herfried,

You are correct. I had tried that and it doesn't work, because the
imagelists are not among the controls. Any ideas?

Thanks,

Doug
Mar 4 '07 #4
Hello Doug,

This code now works. Tested!

Dim t As Integer
Dim iL As ImageList
For t = 0 To Me.components.Components.Count - 1
If TypeOf Me.components.Components(t) Is ImageList Then
iL = Me.components.Components(t)
Debug.WriteLine(iL.ToString)
End If
Next

Best regards,

Martin

Doug Glancy wrote:
"Herfried K. Wagner [MVP]" <hi***************@gmx.atwrote in message
news:Os**************@TK2MSFTNGP03.phx.gbl...
>"Martin H." <hk***@gmx.netschrieb:
>>It works like this:

Dim c As Control
Dim imgL As ImageList

For Each c In Me.Controls
If TypeOf c is ImageList Then
imgL = CType(c, ImageList)
'... Your code here ...
End If
Next
Are you sure this works? ImageList is a component, not a control class.

--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://classicvb.org/petition/>

Herfried,

You are correct. I had tried that and it doesn't work, because the
imagelists are not among the controls. Any ideas?

Thanks,

Doug

Mar 4 '07 #5
Martin,

Thanks. I had gotten to something similar, but was still not able to
identify the ImageLists. For some reason the Name property is not
available. I just realized that I could use the Tag property, so now I can
actually tell which list is which, e.g.:

Debug.WriteLine(iL.Tag)

Thanks for your help.

Doug

"Martin H." <hk***@gmx.netwrote in message
news:45***********************@news.freenet.de...
Hello Doug,

This code now works. Tested!

Dim t As Integer
Dim iL As ImageList
For t = 0 To Me.components.Components.Count - 1
If TypeOf Me.components.Components(t) Is ImageList Then
iL = Me.components.Components(t)
Debug.WriteLine(iL.ToString)
End If
Next

Best regards,

Martin

Doug Glancy wrote:
>"Herfried K. Wagner [MVP]" <hi***************@gmx.atwrote in message
news:Os**************@TK2MSFTNGP03.phx.gbl...
>>"Martin H." <hk***@gmx.netschrieb:
It works like this:

Dim c As Control
Dim imgL As ImageList

For Each c In Me.Controls
If TypeOf c is ImageList Then
imgL = CType(c, ImageList)
'... Your code here ...
End If
Next
Are you sure this works? ImageList is a component, not a control class.

--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://classicvb.org/petition/>

Herfried,

You are correct. I had tried that and it doesn't work, because the
imagelists are not among the controls. Any ideas?

Thanks,

Doug

Mar 5 '07 #6
"Doug Glancy" <no********@replytogroup.comschrieb:
I had gotten to something similar, but was still not able to identify the
ImageLists. For some reason the Name property is not available.
The "(Name)" property shown in the properties window is actually not a
property. It's the name of the private member variable generated for the
component.

--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://dotnet.mvps.org/dotnet/faqs/>

Mar 5 '07 #7

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

Similar topics

3
by: Jenkins | last post by:
I have a page with frames. The left frame is a list of urls. The main frame is loaded based on the url that was clicked in the left frame. Is there a way for the main frame to tell which url was...
4
by: MLH | last post by:
Somehow, I seem to be able to refer to combo-box controls in 2 distinctly different ways. A combo-box on an Access 97 form named TagCountyChooserBox seems can be referenced these ways... ...
1
by: desa | last post by:
If I call EnableVisualStyles none the images in my ImageLists show up in my controls anymore. Is this a known issue? How do I fix this? I'm using VS.NET 2003.
5
by: Paul Tomlinson | last post by:
Tabpages and Imagelists - I want to align the image to the left so I can display some text... All, I have a number of tabpages and on each tab page I currently have an image and some text, now...
3
by: George | last post by:
VS.NET 2002\Web\VB I am trying to get the referring URL for one of my pages using this: Request.UrlReferrer.ToString Page 1 has a link to Page 2. I click on the link in Page 1, and go to...
3
by: Dan Sikorsky | last post by:
How can I get the Querystring passed to the Referring Page from its referrer? I don't want the querystring coming to my current page. I want the querystring that came to the referring page, so...
1
by: eaglei | last post by:
I am having trouble with png files loaded into an imagelist, they are incorrectly showing a blue shadow. Has anyone else got png files working correctly with imagelists?
5
by: Christina | last post by:
I can't seem to find any reference for grabbing the title of the referring page, which I want to use for creating a link. i.e. document.write ("Our thanks to <a href='"+document.referrer+"'>"...
2
by: paladin | last post by:
We have a strange situation where some of the referring URL's are missing from our log files. This is on .NET application on IIS 6.0. Here is what is happening: Page a.aspx has a form that...
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
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...
0
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,...
1
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...
0
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...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
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 ...
0
muto222
php
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.