[ToolBar,Visible=true,Icon="..."]
public class MyControl : Control
{
}
好像是这样的,我也没有用过

解决方案 »

  1.   

    sorry,it's like this.namespace NamespaceA
    {
       [ToolboxBitmap(typeof(ControlA), "MyBitmap.bmp")]
       public class ControlA : System.Windows.Forms.UserControl
       {
          ...
       }
       ...
    }
      

  2.   

    再详细的使用方法你自己查一下msdn吧,
    Index is ToolboxBitmapAttribute class
      

  3.   

    namespace NamespaceA
    {
       [ToolboxBitmap("MyBitmap.bmp")]
       public class ControlA : System.Windows.Forms.UserControl
       {
          ...
       }
       ...
    }
      

  4.   

    我试了一下,是可以的,但是这个东西在运行时也要去找这个图片文件,不能与DLL梆在一起,怎么做才能像VC写的控件那样,把图片一起写在控件里去呢?
    谢谢,可以再给分的