new icon for custom control

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

hey all,

i'm trying to add an image to my custom control so that it looks unique in
my toolbox. i saw in a webcast that all you had to do was add the image to
the project and change the Build Action property to Embedded Resource.

i did that, recompiled it. but when i delete the old item from the toolbox
and add the new dll it still shows the default icon.

does the image need to be a certain size or something, i'm at a loss.

thanks,
rodchar
 
Hi

<ToolboxBitmap("your path to bitmap")> Public Class YourClass

end class

hth

Peter
 
this gets an image out of the assembly

Dim TheAssembly As System.Reflection.Assembly =
System.Reflection.Assembly.GetExecutingAssembly()
Dim TheStream As System.IO.Stream
'The image name must be fully qualified with the assembly name and its
extension, case sensitive
TheStream =
TheAssembly.GetManifestResourceStream("WindowsApplication1.FileName.bmp")
Button1.Image = New System.Drawing.Bitmap(TheStream)

I hth because I have't got time to test if it's usefull in toolboxbitmap
case
 
Thanks...I'll give it try.

Peter Proost said:
this gets an image out of the assembly

Dim TheAssembly As System.Reflection.Assembly =
System.Reflection.Assembly.GetExecutingAssembly()
Dim TheStream As System.IO.Stream
'The image name must be fully qualified with the assembly name and its
extension, case sensitive
TheStream =
TheAssembly.GetManifestResourceStream("WindowsApplication1.FileName.bmp")
Button1.Image = New System.Drawing.Bitmap(TheStream)

I hth because I have't got time to test if it's usefull in toolboxbitmap
case
 

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

Back
Top