Global ImageList

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I do not want to setup and create my ImageList over and over again on
different forms in my project.
Is there any ways to achieve it? so that I will be more easy to manage my
ImageList as well as minimize the performance overhead.

Thanks~
 
Windy,

Than you don't use them as objects however global in your program. That can
be using a module, however I prever a Shared Class.

\\\
Public mySharedValues as class
mImageList as Imagelist
Public shared Property myImageList() as ImageList
Get
return mImageList
End Get
Set (value as ImageList)
mImageList = value
End Set
End Property
End Class
////
You can use your images now as
\\\
mySharedValues.myImageList
///

To see how to use it, just open the + in the designer and copy the code
about the imagelist that the designer created.

You have to type less than I do most goes automaticly by the IDE, so watch
typos or whatever,

I hope this helps,

Cor
 
I do not want to setup and create my ImageList over and over again on
different forms in my project.
Is there any ways to achieve it? so that I will be more easy to manage my
ImageList as well as minimize the performance overhead.

You could pass around a reference to the image list at runtime, but you
cannot assign the image list to controls on multiple forms at design time.
 
Hi Cor,
I still have some difficulties on creating the Image, cannot use design
view to help creating them?
Thanks a lot.
 
Herfried,
You could pass around a reference to the image list at runtime, but you
cannot assign the image list to controls on multiple forms at design time.
I know that I am with my answer in contradiction from a message I made
yesterday.

However OOP should still not be a religion in my opinion.

:-)

Cor
 
Back
Top