Transparent Toolbar Pictures

  • Thread starter Thread starter Boas Enkler
  • Start date Start date
B

Boas Enkler

Hi There

I think this is somekind of newbie question but i can't find out how to get
it work.

I want an toolbar with some Transparent images. But i didn't succeed in
letting the VS 2003 accept the transparencys which were generated by our
graphic tool. So how can I make the background of an image transparent?

Thanks in advance
 
Hi,
You need to use icons for your button images, but a bug in the framework
means you cannot add the icons to the imageList as designtime.

To work round the bug, add the button images to your project (remember to
set build action to embedded resource). Then, using the following code, add
the icons to the inageList at runtime.

System.Reflection.Assembly assembly =
System.Reflection.Assembly.GetExecutingAssembly();
string assembly_Name = assembly.GetName().Name;
imageList1.Images.Add(new Icon(assembly.GetManifestResourceStream(
assembly_Name + ".image1.ico")));
imageList1.Images.Add(new Icon(assembly.GetManifestResourceStream(
assembly_Name + ".image2.ico")));

All the best,
Phil.
 
Back
Top