all groups > dotnet windows forms designtime > january 2005 >
You're in the

dotnet windows forms designtime

group:

ToolboxBitmap in a Resource File


ToolboxBitmap in a Resource File Adam Dockter
1/13/2005 8:15:01 AM
dotnet windows forms designtime:
I want my custom controls to have customer bitmaps but I can't get them to
work if I try to pull the icon from a resource file.

I know that I can add the icon to the project as an embedded resource then
put the attribute.
[ToolboxBitmap(typeof(MyControl),"MyIcon.ico")]

That works fine. But I would really like to put the icon in a resource file
MyControl.resx then use it as the icon. Has anyone ever gotten this to
work. Or has anyone figured out how to compile .ico files as embedded
resources using Nant?

Any help is appreciated.

-Adam dR.

Re: ToolboxBitmap in a Resource File joeycalisay
1/14/2005 11:45:18 AM
http://www.bobpowell.net/toolboxbitmap.htm

[quoted text, click to view]

Re: ToolboxBitmap in a Resource File MailInterface
1/14/2005 9:58:13 PM
I use embedded resource (an Bmp File) as icon at tool box item.i just
added teh file in visualstudio,put it as embedded resource and put
[ToolboxBitmap(typeof(MyControl),"MyIcon.ico")] on my control.it just
works fine.
Re: ToolboxBitmap in a Resource File Adam Dockter
1/17/2005 7:18:41 AM
I have gotten this to work as well, however my companies release build is
done with nant and the only thing I have been able to get nant to compile
for resources are *.resx files. So I am trying to pull the bitmap from one
of those but doesn't seem to be working.


[quoted text, click to view]

AddThis Social Bookmark Button