Hi Daniel,
I believe you need to use icons. Here is a related FAQ item from the FAQ
that is to be released tomorrow:
5.42. How do I add Toolbar buttons with transparency?
Icons support transparency, however, there is a known bug in Visual Studio
..NET 2003 designer that creates incorrect code and makes icons
non-transparent. A work around is to add an icon file to the ImageList
outside of InitializeComponent and add the icon files to the project as
content or embedded resources. The following code demonstrates this:
//C#
using System.Drawing;
using System.IO;
using System.Reflection;
// Loaded as content example
private void Form1_Load(object sender, System.EventArgs e)
{
this.imageList1.Images.Add(new Icon(File.Open("fullFileName.ico",
FileMode.Open)));
this.toolBar1.Buttons[0].ImageIndex = 0;
}
// Loaded as a resource example
private void Form1_Load(object sender, System.EventArgs e)
{
this.imageList1.Images.Add(new
Icon(Assembly.GetExecutingAssembly().GetManifestResourceStream(
".filename.ico")));
this.toolBar1.Buttons[0].ImageIndex = 0;
}
'VB
Imports System.Drawing
Imports System.IO
Imports System.Reflection
' Loaded as content example
Private Sub Form1_Load1(ByVal sender As Object, ByVal e As System.EventArgs)
Me.imageList1.Images.Add(New Icon(File.Open("fullFileName.ico", _
FileMode.Open)))
Me.toolBar1.Buttons(0).ImageIndex = 0
End Sub 'Form1_Load1
' Loaded as a resource example
Private Sub Form1_Load2(ByVal sender As Object, ByVal e As System.EventArgs)
Me.imageList1.Images.Add(New _
Icon([Assembly].GetExecutingAssembly().GetManifestResourceStream( _
".filename.ico")))
Me.toolBar1.Buttons(0).ImageIndex = 0
End Sub 'Form1_Load2
--
Geoff Schwab
Program Manager
Excell Data Corporation
http://msdn.com/mobility
http://msdn.microsoft.com/mobility/prodtechinfo/devtools/netcf/FAQ/default.aspx
This posting is provided "AS IS" with no warranties, and confers no rights.