Hey Wossy.
This seems to work just fine.

VB Code:
  1. Dim b As New Bitmap(16, 16, Imaging.PixelFormat.Format32bppArgb)
  2.  
  3. 'Some drawing here
  4.  
  5. Me.Icon = Icon.FromHandle(b.GetHicon)