Bitmap to Icon conversion

  • Thread starter Thread starter Urs Vogel
  • Start date Start date
U

Urs Vogel

Hi

I have an image list with icons and would like to change the form icon
depending on an operating mode, but I couldn't figure out how to re-assign
an image from the image list to the form.icon property.

Thanks fo a hint.

Urs
 
* "Urs Vogel said:
I have an image list with icons and would like to change the form icon
depending on an operating mode, but I couldn't figure out how to re-assign
an image from the image list to the form.icon property.

\\\
Dim b As Bitmap = ...
Dim hIcon As IntPtr = b.GetHicon()
Dim i As Icon = Icon.FromHandle(hIcon)
Me.Icon = i
///
 
* "Cor Ligthert said:
I was always think how that was going,

I forgot to mention that the code will basically work, but not the
original icon is restored.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads

Convert Image to Icon 3
Icon to Image 4
Icon Chalange 2
Extract Icon 7
Save Icon in different sizes 2
Bitmap.FromHicon 2
Overlay bitmap on icon 2
Setting Application Icon using code 1

Back
Top