> Rod, i found it myself (i use me.) is it right?
> 'here Tbox is my class
> 'Textbox is the name of the bitmat (I add
> Textbox.bmp into the resources)
This is something Microsoft seems to have really messed up. I have had terrible luck getting this to work.
There's a very informative article at:
But I still have trouble if teh namespace has been changed.
I recommend one of two approaches.
1. Use the other version of the ToolboxBitmap attribute where you pass in the full path to the bitmap file as in:
This seems heavy-handed because you'll need to change the code if you move the project but at least it's easy to understand.
2. Ensure that the project's root namespace matches the assembly's name. Double-click My Project, go to the Application tab, and make sure the Assembly Name and Root Namespace match. Then select the resource file in Project Explorer (Textbox.bmp in your case), go to the Properties window, and set Build Action to Embedded Resource. Finally, use a statement like this:
<ToolboxBitmap(GetType(Tbox), "Textbox")> _
What a mess, huh? I haven't had a chance to try anything with the resfinder class suggested in that article.
If anyone has a better more consistent solution, please let me know!
Author of "Visual Basic 2005 Programmer's Reference"
Sign up for the free VB
Helper Newsletters at http://www.vb-helper.com/newsletter.html