ToolboxBitmap isn't working... The on going saga
-
I have created two UserControls to try and resolve this.
namespace libSigCntrl
{
//[ToolboxItem(true)]
//[ToolboxBitmap(typeof(ctrlBankBitSW), "ctrlBankBitSW.bmp")]
[ToolboxBitmap(typeof(ctrlBankBitSW))]
public partial class ctrlBankBitSW : UserControl
{
public ctrlBankBitSW()
{
InitializeComponent();
}
}
}
namespace libSigCntrl
{
//[ToolboxItem(true)]
//[ToolboxBitmap(typeof(ctrlBitSW), "ctrlBitSW")]
[ToolboxBitmap(typeof(ctrlBitSW))]
public partial class ctrlBitSW : UserControl
{
public ctrlBitSW()
{
InitializeComponent();
}
}
}The commented lines represent other attempts. There are bitmaps for each of the controls added to the project libSigCtrl - - - ctrlBankBitSW.bmp - ctrlBankBitSW.cs . . - ctrlBitSW.bmp - ctrlBitSW.cs The Bitmaps have there "Build Actions" = been set to "Embeded Resource" The Bitmaps are 16x16 at 16 color. The Output Type is "Class Library". This is driving me nuts. :wtf:
-
I have created two UserControls to try and resolve this.
namespace libSigCntrl
{
//[ToolboxItem(true)]
//[ToolboxBitmap(typeof(ctrlBankBitSW), "ctrlBankBitSW.bmp")]
[ToolboxBitmap(typeof(ctrlBankBitSW))]
public partial class ctrlBankBitSW : UserControl
{
public ctrlBankBitSW()
{
InitializeComponent();
}
}
}
namespace libSigCntrl
{
//[ToolboxItem(true)]
//[ToolboxBitmap(typeof(ctrlBitSW), "ctrlBitSW")]
[ToolboxBitmap(typeof(ctrlBitSW))]
public partial class ctrlBitSW : UserControl
{
public ctrlBitSW()
{
InitializeComponent();
}
}
}The commented lines represent other attempts. There are bitmaps for each of the controls added to the project libSigCtrl - - - ctrlBankBitSW.bmp - ctrlBankBitSW.cs . . - ctrlBitSW.bmp - ctrlBitSW.cs The Bitmaps have there "Build Actions" = been set to "Embeded Resource" The Bitmaps are 16x16 at 16 color. The Output Type is "Class Library". This is driving me nuts. :wtf:
There are two scenarios, and it would be useful to know which applies, in order to try to help. Scenario 1. You are looking to add one of your controls to a designer in the same solution as the controls, but you have not yet explicitly added your controls to the toolbox. Scenario 2. You have explicitly added your controls to the toolbox, and they do not display the assigned image. Please say which.
Henry Minute Do not read medical books! You could die of a misprint. - Mark Twain Girl: (staring) "Why do you need an icy cucumber?" “I want to report a fraud. The government is lying to us all.”
-
There are two scenarios, and it would be useful to know which applies, in order to try to help. Scenario 1. You are looking to add one of your controls to a designer in the same solution as the controls, but you have not yet explicitly added your controls to the toolbox. Scenario 2. You have explicitly added your controls to the toolbox, and they do not display the assigned image. Please say which.
Henry Minute Do not read medical books! You could die of a misprint. - Mark Twain Girl: (staring) "Why do you need an icy cucumber?" “I want to report a fraud. The government is lying to us all.”
I don't think either. I have created a project with to two controls in the project. The project is a class library that will hold a variety of "Controls" extending UserControl... Maybe it is Scenario 1. The user controls do show up in on my solution palette but with the default cog image. Does that help Henry. If now and I will try again to clarify. Gregg
-
There are two scenarios, and it would be useful to know which applies, in order to try to help. Scenario 1. You are looking to add one of your controls to a designer in the same solution as the controls, but you have not yet explicitly added your controls to the toolbox. Scenario 2. You have explicitly added your controls to the toolbox, and they do not display the assigned image. Please say which.
Henry Minute Do not read medical books! You could die of a misprint. - Mark Twain Girl: (staring) "Why do you need an icy cucumber?" “I want to report a fraud. The government is lying to us all.”
If you can check out www.experts-exchange.com/Programming/Languages/C_Sharp/Q_24283292.html
-
I don't think either. I have created a project with to two controls in the project. The project is a class library that will hold a variety of "Controls" extending UserControl... Maybe it is Scenario 1. The user controls do show up in on my solution palette but with the default cog image. Does that help Henry. If now and I will try again to clarify. Gregg
I thought that this might be the case. What you are getting is the correct behaviour. Whilst the Library containing your controls is included in a solution, the system does not use the assigned icon. It always uses the Cog icon. To find out if your icon assignments are working you have to manually install your controls into the Toolbox. For the easy way to do that take a look at this[^]. The 'standard' way to do it is to right click on the toolbox, in the section where you want your controls added, select 'add items' or 'choose items' depending on version of VS. When the dialogue appears click the browse button, navigate to and select your dll and then click OK. Before doing either of the above, you might also want to right click the toolbox and select 'Add Tab'. You can then call it 'My Controls' or whatever you like, to keep your stuff separate. If you do this, when you right-click to add the controls, make sure to right-click in your new tab, so that the controls are added there. Hope this helps.
Henry Minute Do not read medical books! You could die of a misprint. - Mark Twain Girl: (staring) "Why do you need an icy cucumber?" “I want to report a fraud. The government is lying to us all.”