Home All Groups Group Topic Archive Search About

Image list controls and image resources

Author
20 Sep 2006 11:17 PM
Mark
Hi

I notice that in some cases, to get an icon, an object (for example a list
view) uses an image list, in others (e.g. a form) the image is selected from
the project resources, i.e. a file.

As I have images that I'd like to use in both situations I would like to use
the same method for each. Preferably, as I find importing images as
resources as often as not crashes VS, I would like to work with an image
list.

Anyone know if this is possible?

Thanks in advance

Mark
PS Sorry if I completely missed something obvious...

Author
21 Sep 2006 4:49 AM
Cor Ligthert [MVP]
Mark,

At least for me it is not clear what is the problem. Did you try it?

Cor

Show quoteHide quote
"Mark" <m*@abc.com> schreef in bericht
news:PZjQg.29670$cx.17040@newsfe1-gui.ntli.net...
> Hi
>
> I notice that in some cases, to get an icon, an object (for example a list
> view) uses an image list, in others (e.g. a form) the image is selected
> from the project resources, i.e. a file.
>
> As I have images that I'd like to use in both situations I would like to
> use the same method for each. Preferably, as I find importing images as
> resources as often as not crashes VS, I would like to work with an image
> list.
>
> Anyone know if this is possible?
>
> Thanks in advance
>
> Mark
> PS Sorry if I completely missed something obvious...
>
Author
22 Sep 2006 5:15 PM
Mark
Hi Cor

Sorry I was a little vague... Basically there are 2 problems:

1) I would like to contain all my icons in one image list that could be used
for form icons (i.e. the one that appears in the title bar), as well as list
and tree views etc. There appears to be no image list property for forms,
the icon property being a file reference.

2) When I import icons, as resources, to use as form icons VS crashes. On
restarting it is ok and the icon is available, but its a slow crash nd a
real time waster.

I have a database which the users can assign icons to specific record types.
I would like to use these icons both when the record is displayed in a
treeview (for example) and as the forms icon when the record is opened. I
would like both situations to use the same icon without having to keep an
image list and folder full of icon resources synchronised some how.

I hope this makes sense...?

Cheers (and thanks)

Mark

Show quoteHide quote
"Cor Ligthert [MVP]" <notmyfirstn***@planet.nl> wrote in message
news:Ony2ukT3GHA.988@TK2MSFTNGP02.phx.gbl...
> Mark,
>
> At least for me it is not clear what is the problem. Did you try it?
>
> Cor
>
> "Mark" <m*@abc.com> schreef in bericht
> news:PZjQg.29670$cx.17040@newsfe1-gui.ntli.net...
>> Hi
>>
>> I notice that in some cases, to get an icon, an object (for example a
>> list view) uses an image list, in others (e.g. a form) the image is
>> selected from the project resources, i.e. a file.
>>
>> As I have images that I'd like to use in both situations I would like to
>> use the same method for each. Preferably, as I find importing images as
>> resources as often as not crashes VS, I would like to work with an image
>> list.
>>
>> Anyone know if this is possible?
>>
>> Thanks in advance
>>
>> Mark
>> PS Sorry if I completely missed something obvious...
>>
>
>
Author
23 Sep 2006 5:39 AM
Cor Ligthert [MVP]
Mark,

This is a question I have in my idea seen many times answered by Herfried,

Can you search for yourself in these newsgroups threads where that was in.
http://groups.google.com/group/microsoft.public.dotnet.languages.vb/search?q=Herfried+icons+imagelist&

I hope this helps,

Cor

Show quoteHide quote
"Mark" <m*@abc.com> schreef in bericht
news:aTUQg.31452$cx.19168@newsfe1-gui.ntli.net...
> Hi Cor
>
> Sorry I was a little vague... Basically there are 2 problems:
>
> 1) I would like to contain all my icons in one image list that could be
> used for form icons (i.e. the one that appears in the title bar), as well
> as list and tree views etc. There appears to be no image list property for
> forms, the icon property being a file reference.
>
> 2) When I import icons, as resources, to use as form icons VS crashes. On
> restarting it is ok and the icon is available, but its a slow crash nd a
> real time waster.
>
> I have a database which the users can assign icons to specific record
> types. I would like to use these icons both when the record is displayed
> in a treeview (for example) and as the forms icon when the record is
> opened. I would like both situations to use the same icon without having
> to keep an image list and folder full of icon resources synchronised some
> how.
>
> I hope this makes sense...?
>
> Cheers (and thanks)
>
> Mark
>
> "Cor Ligthert [MVP]" <notmyfirstn***@planet.nl> wrote in message
> news:Ony2ukT3GHA.988@TK2MSFTNGP02.phx.gbl...
>> Mark,
>>
>> At least for me it is not clear what is the problem. Did you try it?
>>
>> Cor
>>
>> "Mark" <m*@abc.com> schreef in bericht
>> news:PZjQg.29670$cx.17040@newsfe1-gui.ntli.net...
>>> Hi
>>>
>>> I notice that in some cases, to get an icon, an object (for example a
>>> list view) uses an image list, in others (e.g. a form) the image is
>>> selected from the project resources, i.e. a file.
>>>
>>> As I have images that I'd like to use in both situations I would like to
>>> use the same method for each. Preferably, as I find importing images as
>>> resources as often as not crashes VS, I would like to work with an image
>>> list.
>>>
>>> Anyone know if this is possible?
>>>
>>> Thanks in advance
>>>
>>> Mark
>>> PS Sorry if I completely missed something obvious...
>>>
>>
>>
>
>
Author
23 Sep 2006 4:52 PM
Mark
Thanks again Cor (and also thanks to Herfried)

Managed to find the following (but haven't tried it yet)

    Dim ico As Icon

    Dim bmIcon As Bitmap = CType(ImageList1.Images(0), Bitmap)

    ico = Icon.FromHandle(bmIcon.GetHicon)

    Me.Icon = ico

Cheers

Mark



Show quoteHide quote
"Cor Ligthert [MVP]" <notmyfirstn***@planet.nl> wrote in message
news:uByhDKt3GHA.1568@TK2MSFTNGP03.phx.gbl...
> Mark,
>
> This is a question I have in my idea seen many times answered by Herfried,
>
> Can you search for yourself in these newsgroups threads where that was in.
> http://groups.google.com/group/microsoft.public.dotnet.languages.vb/search?q=Herfried+icons+imagelist&
>
> I hope this helps,
>
> Cor
>
> "Mark" <m*@abc.com> schreef in bericht
> news:aTUQg.31452$cx.19168@newsfe1-gui.ntli.net...
>> Hi Cor
>>
>> Sorry I was a little vague... Basically there are 2 problems:
>>
>> 1) I would like to contain all my icons in one image list that could be
>> used for form icons (i.e. the one that appears in the title bar), as well
>> as list and tree views etc. There appears to be no image list property
>> for forms, the icon property being a file reference.
>>
>> 2) When I import icons, as resources, to use as form icons VS crashes. On
>> restarting it is ok and the icon is available, but its a slow crash nd a
>> real time waster.
>>
>> I have a database which the users can assign icons to specific record
>> types. I would like to use these icons both when the record is displayed
>> in a treeview (for example) and as the forms icon when the record is
>> opened. I would like both situations to use the same icon without having
>> to keep an image list and folder full of icon resources synchronised some
>> how.
>>
>> I hope this makes sense...?
>>
>> Cheers (and thanks)
>>
>> Mark
>>
>> "Cor Ligthert [MVP]" <notmyfirstn***@planet.nl> wrote in message
>> news:Ony2ukT3GHA.988@TK2MSFTNGP02.phx.gbl...
>>> Mark,
>>>
>>> At least for me it is not clear what is the problem. Did you try it?
>>>
>>> Cor
>>>
>>> "Mark" <m*@abc.com> schreef in bericht
>>> news:PZjQg.29670$cx.17040@newsfe1-gui.ntli.net...
>>>> Hi
>>>>
>>>> I notice that in some cases, to get an icon, an object (for example a
>>>> list view) uses an image list, in others (e.g. a form) the image is
>>>> selected from the project resources, i.e. a file.
>>>>
>>>> As I have images that I'd like to use in both situations I would like
>>>> to use the same method for each. Preferably, as I find importing images
>>>> as resources as often as not crashes VS, I would like to work with an
>>>> image list.
>>>>
>>>> Anyone know if this is possible?
>>>>
>>>> Thanks in advance
>>>>
>>>> Mark
>>>> PS Sorry if I completely missed something obvious...
>>>>
>>>
>>>
>>
>>
>
>