ToolboxBitmap Icon
-
[ToolboxBitmap(typeof(myNamesapce.myControl), "myNamespace.FlatComboBox.bmp"]
How can i change the icon defaul of the custom control Thanks Rock Throught The Night -
[ToolboxBitmap(typeof(myNamesapce.myControl), "myNamespace.FlatComboBox.bmp"]
How can i change the icon defaul of the custom control Thanks Rock Throught The NightYou might start by reading about the
ToolboxBitmapAttribute
. The reason you include the Type is to provide a namespace in order to resolve the bitmap. Just attribute your control with:[ToolboxBitmap(typeof(myNamespace.myControl), "FlatComboBox.bmp")]
"myNamespace" is grabbed from the Type and prepends the filename to find the embedded resource. Make sure you change the Build Action in VS.NET for the "FlatComboBox.bmp" to "Embedded Resource" and that it is contained in your project with the root namespace set to "myNamespace", or in a folder which is used to generate the namespace for embedded resources (and used for the default namespace for new source files, although you can change it).
Microsoft MVP, Visual C# My Articles