ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   imagelist filling at designtime (https://www.excelbanter.com/excel-programming/409681-imagelist-filling-designtime.html)

Ernst Schuurman

imagelist filling at designtime
 
Hi XL-guru's

First I like to express my admiration for your expertise.
I read the posts in this NG for 5 months on a daily basis and I've learned
so much allready.
It's both interesting and educational to see how different approaches solve
one problem.
But now it's my turn to ask for your help.

I need to fill an imagelist with icons that I will use for a treeview in a
userform.
Using Ron de Bruin's Googlesearch I found an exellent example on Chip
Pearson's site.
Great tool that I use many times that Googlesearch.(thanks Ron)

From Chips example I could create my solution as disired, but I am lost on
this one:

the imagelist containing the icons is now filled at runtime.
Because in my application the imagelist contents will not change I want to
fill it once at disigntime.

I found some explanation on different sites, but can't reproduce it.

The dialog that should appear when you choose properties does not appear
when using an imagelist on a userform.
I do get this dialog when the imagelist is added to a worksheet, but I can
not cot/paste that to my userform.

Am I doing something wrong, or is there another explanation?

Kind regards,

Ernst



Rick Rothstein \(MVP - VB\)[_1768_]

imagelist filling at designtime
 
I'm not sure if the ImageList control you are talking about is the one I
have available in my system or not. I have VB6 installed on my system (so
I'm not sure if it installed the ImageList control I'm using or not)... the
ImageList control that I get to add to the Toolbox is listed in the
Additional Controls dialog as...

Microsoft ImageList Control 6.0 (SP6)

If that is the one you are using, then when I add it my UserForm, the
Properties window has an entry named Custom which allows you to add images
at design time.

Rick


"Ernst Schuurman" wrote in message
...
Hi XL-guru's

First I like to express my admiration for your expertise.
I read the posts in this NG for 5 months on a daily basis and I've learned
so much allready.
It's both interesting and educational to see how different approaches
solve one problem.
But now it's my turn to ask for your help.

I need to fill an imagelist with icons that I will use for a treeview in a
userform.
Using Ron de Bruin's Googlesearch I found an exellent example on Chip
Pearson's site.
Great tool that I use many times that Googlesearch.(thanks Ron)

From Chips example I could create my solution as disired, but I am lost on
this one:

the imagelist containing the icons is now filled at runtime.
Because in my application the imagelist contents will not change I want to
fill it once at disigntime.

I found some explanation on different sites, but can't reproduce it.

The dialog that should appear when you choose properties does not appear
when using an imagelist on a userform.
I do get this dialog when the imagelist is added to a worksheet, but I can
not cot/paste that to my userform.

Am I doing something wrong, or is there another explanation?

Kind regards,

Ernst



Jim Cone[_2_]

imagelist filling at designtime
 
Ernst,
In the properties window (for the ImageList control) in the VBE,
select "Custom". The Property Pages form for the ImageList pops up.
Insert your pictures on the Images tab.
--
Jim Cone
Portland, Oregon USA
http://www.realezsites.com/bus/primitivesoftware
(Excel Add-ins / Excel Programming)



"Ernst Schuurman"
wrote in message
Hi XL-guru's

First I like to express my admiration for your expertise.
I read the posts in this NG for 5 months on a daily basis and I've learned
so much allready.
It's both interesting and educational to see how different approaches solve
one problem.
But now it's my turn to ask for your help.

I need to fill an imagelist with icons that I will use for a treeview in a
userform.
Using Ron de Bruin's Googlesearch I found an exellent example on Chip
Pearson's site.
Great tool that I use many times that Googlesearch.(thanks Ron)
From Chips example I could create my solution as disired, but I am lost on
this one:
the imagelist containing the icons is now filled at runtime.
Because in my application the imagelist contents will not change I want to
fill it once at disigntime.
I found some explanation on different sites, but can't reproduce it.
The dialog that should appear when you choose properties does not appear
when using an imagelist on a userform.
I do get this dialog when the imagelist is added to a worksheet, but I can
not cot/paste that to my userform.
Am I doing something wrong, or is there another explanation?
Kind regards,
Ernst



Ernst Schuurman

imagelist filling at designtime
 
Hi Rick,

Thank you for your response.
I am using then Microsoft ImageList Control 6.0 (SP6)
I just found that before adding the control to the userform I can get the
dialog by using custom in the right click menu from the userforms toolbar.
but when typing the following line into the immidiate window after stepping
into the first line of the UserForm_Initialize procedure

?ImgLijst.ListImages.Count

I get 0 as result. where ImgLijst is the imagelist's name.

starting the userform results in an errormessage:

ImageList must be initialised before it can be used.

So that gives me the impression that there are not realy pictures added.

I am sure I've added 5 pictures to the ImageList before I added it to the
userform.

And when it is added to the form I see no custom option anymore.

So I must do something wrong, but I am not sure what.


"Rick Rothstein (MVP - VB)" schreef in
bericht ...
I'm not sure if the ImageList control you are talking about is the one I
have available in my system or not. I have VB6 installed on my system (so
I'm not sure if it installed the ImageList control I'm using or not)...
the ImageList control that I get to add to the Toolbox is listed in the
Additional Controls dialog as...

Microsoft ImageList Control 6.0 (SP6)

If that is the one you are using, then when I add it my UserForm, the
Properties window has an entry named Custom which allows you to add images
at design time.

Rick


"Ernst Schuurman" wrote in message
...
Hi XL-guru's

First I like to express my admiration for your expertise.
I read the posts in this NG for 5 months on a daily basis and I've
learned so much allready.
It's both interesting and educational to see how different approaches
solve one problem.
But now it's my turn to ask for your help.

I need to fill an imagelist with icons that I will use for a treeview in
a userform.
Using Ron de Bruin's Googlesearch I found an exellent example on Chip
Pearson's site.
Great tool that I use many times that Googlesearch.(thanks Ron)

From Chips example I could create my solution as disired, but I am lost
on this one:

the imagelist containing the icons is now filled at runtime.
Because in my application the imagelist contents will not change I want
to fill it once at disigntime.

I found some explanation on different sites, but can't reproduce it.

The dialog that should appear when you choose properties does not appear
when using an imagelist on a userform.
I do get this dialog when the imagelist is added to a worksheet, but I
can not cot/paste that to my userform.

Am I doing something wrong, or is there another explanation?

Kind regards,

Ernst





Rick Rothstein \(MVP - VB\)[_1769_]

imagelist filling at designtime
 
As a test, after going to the Image tab on the Custom dialog for the
ImageList control and Inserting two BMP pictures, I added...

Private Sub UserForm_Initialize()
Debug.Print ImageList1.ListImages.Count
End Sub

to the UserForm's code window and ran the program... it printed 2 to the
Immediate window.

Rick


"Ernst Schuurman" wrote in message
...
Hi Rick,

Thank you for your response.
I am using then Microsoft ImageList Control 6.0 (SP6)
I just found that before adding the control to the userform I can get the
dialog by using custom in the right click menu from the userforms toolbar.
but when typing the following line into the immidiate window after
stepping into the first line of the UserForm_Initialize procedure

?ImgLijst.ListImages.Count

I get 0 as result. where ImgLijst is the imagelist's name.

starting the userform results in an errormessage:

ImageList must be initialised before it can be used.

So that gives me the impression that there are not realy pictures added.

I am sure I've added 5 pictures to the ImageList before I added it to the
userform.

And when it is added to the form I see no custom option anymore.

So I must do something wrong, but I am not sure what.


"Rick Rothstein (MVP - VB)" schreef
in bericht ...
I'm not sure if the ImageList control you are talking about is the one I
have available in my system or not. I have VB6 installed on my system (so
I'm not sure if it installed the ImageList control I'm using or not)...
the ImageList control that I get to add to the Toolbox is listed in the
Additional Controls dialog as...

Microsoft ImageList Control 6.0 (SP6)

If that is the one you are using, then when I add it my UserForm, the
Properties window has an entry named Custom which allows you to add
images at design time.

Rick


"Ernst Schuurman" wrote in message
...
Hi XL-guru's

First I like to express my admiration for your expertise.
I read the posts in this NG for 5 months on a daily basis and I've
learned so much allready.
It's both interesting and educational to see how different approaches
solve one problem.
But now it's my turn to ask for your help.

I need to fill an imagelist with icons that I will use for a treeview in
a userform.
Using Ron de Bruin's Googlesearch I found an exellent example on Chip
Pearson's site.
Great tool that I use many times that Googlesearch.(thanks Ron)

From Chips example I could create my solution as disired, but I am lost
on this one:

the imagelist containing the icons is now filled at runtime.
Because in my application the imagelist contents will not change I want
to fill it once at disigntime.

I found some explanation on different sites, but can't reproduce it.

The dialog that should appear when you choose properties does not appear
when using an imagelist on a userform.
I do get this dialog when the imagelist is added to a worksheet, but I
can not cot/paste that to my userform.

Am I doing something wrong, or is there another explanation?

Kind regards,

Ernst







All times are GMT +1. The time now is 06:38 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com