Hi,
I have created a custom control called IFrame. When i complie i get the famous blue defualt gear icon on the toolbox. I then created a new project and added the DLL and i got the control to show up and of course with the default blue bitmap. Now the fun begins: I then went back to the my DLL project and i have tryed all the following permutations and i can't get the bitmap to show up.
O yeah, i created a Bitmap called IFrame.bmp thru the VS 2005 IDE and made it 16x16 with 16 colors. Also made it embeded as well.
Tryed:
[
ToolboxBitmap(typeof(IFrame), "IFrame.bmp" )][
ToolboxBitmap(typeof(IFrame), "IFrame" )][
ToolboxBitmap(typeof(MyNamespace.IFrame), "IFrame.bmp" )][
ToolboxBitmap(typeof(IFrame))]Even tryed: I renamed the bmp file to IFrame.IFrame.bmp
[
ToolboxBitmap("IFrame.IFrame.bmp" )]And yet Even tryed: I right-clicked on my project and added a resource in which i imported the BMP in question here and then tryed all the above and still no go.
NOTE: If i spcify to use a control already defined such as a Label or Button ect.. it works fine. I can even specify the IFrame.bmp using a path to it and that works as such:
[
ToolboxBitmap(typeof(Button))] <-- That works[
ToolboxBitmap("c:\IFrame.bmp" )] <-- That works
Thanks for any help i can get as i have tryed everything that on the web so even a "Yeah its a bug will help" :-)
Thanks!

ToolBoxBitmap not showing for custom control
EnigMa_AnGeL
2: dunno, and I don't want to find out. It took me a day to recover from yet another toolbar bug after I worked on that answer. Check this thread for the gory details.
BCossa
Alex Yakhnin - MSFT
Good God! :-)
Ok her eis a little update on my findings. The fix like i said works great except in my situation it also causes yet another problem. The problem is that i'm working with the designer and so since my main class is not the first class, i get an error. Following i the error i get and a snipet of code: Thanks for the help
internal class resfinder{} <--- Note this becomes the first class.
namespace
Gui.IFrame{
[
Designer( typeof( Gui.IFrame.IFrameDesigner ) )] <-- Designer does not like this[
ToolboxItem( true )][
ToolboxBitmap( typeof( IFrame ), "IFrame.IFrame.bmp" )] public partial class IFrame : System.Windows.Forms.UserControl{
}
}
Error:
The class IFrame can be designed, but is not the first class in the file. Visual Studio requires that designers use the first class in the file. Move the class code so that it is the first class in the file and try loading the designer again.
at System.ComponentModel.Design.Serialization.CodeDomDesignerLoader.EnsureDocument(IDesignerSerializationManager manager)
at System.ComponentModel.Design.Serialization.CodeDomDesignerLoader.PerformLoad(IDesignerSerializationManager manager)
at Microsoft.VisualStudio.Design.Serialization.CodeDom.VSCodeDomDesignerLoader.PerformLoad(IDesignerSerializationManager serializationManager)
at System.ComponentModel.Design.Serialization.BasicDesignerLoader.BeginLoad(IDesignerLoaderHost host)
Cla82
Thanks again!
Newbie75
Hi!
Porko
nobugz,
Thanks a bunch as that did the trick. I do have 2 questions:
1) Is this a bug and if so do you know if its fixed in the upcoming SP's
2) Do i need to do the same thing if i decide to import the bitmap into a resource file instead of having it directly under the solution
Note: I was having the same problem when i inserted the bitmap into a resx file which i prefer to do.
Thanks again!
simon_56387