471,119 Members | 1,499 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,119 software developers and data experts.

Global ImageList

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~
Jan 31 '06 #1
5 3339
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

<Windy> schreef in bericht news:OK**************@TK2MSFTNGP14.phx.gbl...
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~

Jan 31 '06 #2
<Windy> schrieb:
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.

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

Jan 31 '06 #3
Hi Cor,
I still have some difficulties on creating the Image, cannot use design
view to help creating them?
Thanks a lot.

"Cor Ligthert [MVP]" <no************@planet.nl> 撰寫於郵件新聞:u9**************@TK2MSFTNGP10.phx.g bl...
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

<Windy> schreef in bericht news:OK**************@TK2MSFTNGP14.phx.gbl...
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~


Jan 31 '06 #4
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
Jan 31 '06 #5
Hi Herfried, Cor
Thanks you for the information
<Windy> 撰寫於郵件新聞:OK**************@TK2MSFTNGP14.phx.g bl...
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~

Feb 1 '06 #6

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

2 posts views Thread by Bob C. | last post: by
7 posts views Thread by Andrew Christiansen | last post: by
4 posts views Thread by Just Me | last post: by
4 posts views Thread by Omega | last post: by
6 posts views Thread by henrycortezwu | last post: by
1 post views Thread by Sagaert Johan | last post: by
2 posts views Thread by =?Utf-8?B?S2VuTg==?= | last post: by

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.