Marco,
IIUC correctly you want to synronize form's icon to a button, you can
do this with the following:
' First save form's icon to somewhere (eg: C: drive)
Me.Icon.ToBitmap.Save("c:\icon.ico",
System.Drawing.Imaging.ImageFormat.Icon)
'Then call this icon image as button's image
Button1.Image = Button1.Image.FromFile("c:\icon.ico")
'
-------------------------------------------------------------------------------
If you button is present and you want to create a new one on runtime:
'Set button properties as you wish (optional)
Me.Icon.ToBitmap.Save("c:\icon.ico",
System.Drawing.Imaging.ImageFormat.Icon)
Dim button As New Button
Me.Controls.Add(button)
button.Name = "button1"
button.Image = button.Image.FromFile("c:\icon.ico")
Hope this helps
Sorry, some grammer mistakes
(I meant if your button is "not" present);
If i understood your issue correctly, you want to syncronize form's
icon to a button, you can
do this with the following:
' First save form's icon to somewhere (eg: C: drive)
Me.Icon.ToBitmap.Save("c:\icon.ico",
System.Drawing.Imaging.ImageFormat.Icon)
'Then call this icon image as button's image
Button1.Image = Button1.Image.FromFile("c:\icon.ico")
'
-------------------------------------------------------------------------------
If your button is NOT present and you want to create a new one on
runtime:
'Set button properties as you wish (optional)
Me.Icon.ToBitmap.Save("c:\icon.ico",
System.Drawing.Imaging.ImageFormat.Icon)
Dim button As New Button
Me.Controls.Add(button)
button.Name = "button1"
button.Image = button.Image.FromFile("c:\icon.ico")
Hope this helps!