Friday, November 2, 2012

'System.Drawing.Image' converted to 'System.Drawing.Icon in Windows Form Application

Here Is a simple solution when you get this error.You get this error when you are trying to change icon at runtime .Here is a simple Solution to that.

Dim img As Image = 'Whatever your image is...
Dim bm As Bitmap = img
Dim hIcon As IntPtr = bm.GetHicon
Dim TheIcon As Icon = Icon.FromHandle(hIcon)

No comments :

Post a Comment