Home All Groups Group Topic Archive Search About
Author
31 Jan 2006 6:56 AM
Windy
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~

Author
31 Jan 2006 7:11 AM
Cor Ligthert [MVP]
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

Show quoteHide quote
<Windy> schreef in bericht news:OKM7vKjJGHA.3000@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~
>
Author
31 Jan 2006 10:46 AM
Windy
Hi Cor,
    I still have some difficulties on creating the Image, cannot use design
view to help creating them?
Thanks a lot.



Show quoteHide quote
"Cor Ligthert [MVP]" <notmyfirstn***@planet.nl> ¼¶¼g©ó¶l¥ó·s»D:u9DiCWjJGHA.3***@TK2MSFTNGP10.phx.gbl...
> 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:OKM7vKjJGHA.3000@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~
>>
>
>
Author
31 Jan 2006 7:17 AM
Herfried K. Wagner [MVP]
<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/>
Author
31 Jan 2006 10:54 AM
Cor Ligthert [MVP]
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
Author
1 Feb 2006 4:38 PM
Windy
Hi Herfried, Cor
Thanks you for the information


<Windy> ¼¶¼g©ó¶l¥ó·s»D:OKM7vKjJGHA.3***@TK2MSFTNGP14.phx.gbl...
Show quoteHide quote
>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~
>