views:

20

answers:

1

I have a UserControl in my project called 'UIWizard.cs', and a 24-bit Bitmap named 'UIWizardToolboxBitmap.bmp' that has it's build action set to 'Embedded Resource'. I verified that it does exist in the manifest:

.mresource public BitFlex.Windows.Forms.Resources.UIWizardToolboxBitmap.bmp
{
    // Offset: 0x00000000 Length: 0x00000336
}

I have tried these attribute declarations:

[ToolboxBitmap(typeof(UIWizard), "BitFlex.Windows.Forms.Resources.UIWizardToolboxBitmap.bmp")]
public partial class UIWizard : UserControl {

[ToolboxBitmap(typeof(UIWizard), "UIWizardToolboxBitmap.bmp")]
public partial class UIWizard : UserControl {

[ToolboxBitmap(typeof(UIWizard), "UIWizardToolboxBitmap")]
public partial class UIWizard : UserControl {

When I set my library to 'Release Build' and reference it in another project and add the ToolBox items manually using Choose Items... it still fails to display my bitmap properly. I want to avoid using a absolute path, because this is a source controlled project, and not everyone will be using the same mappings.

MSDN really isn't much help as the documentation on the ToolBoxBitmapAttribute is lacking, and most of what's on the web is pretty vague.

+1  A: 

It is all bitmap format.
1. If I remember right we are used 256 colors, 16x16 73DPI bitmap.
2. Also try to add [ToolBoxItem(true)] to your class

Sergey Mirvoda
[ToolboxBitmap(typeof(UIWizard), "Resources.UIWizardToolboxBitmap")][ToolBoxItem(true)]public partial class UIWizard : UserControl {Works.
David Anderson