Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C#
  4. ToolBoxBitmap

ToolBoxBitmap

Scheduled Pinned Locked Moved C#
csharptestingdebuggingbeta-testing
4 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • A Offline
    A Offline
    aSarafian
    wrote on last edited by
    #1

    I have created my own custom progressbar controls and i wish to assign them an icon for the toolbox. I have read everything i found on the net including the super http://www.bobpowell.net/toolboxbitmap.htm[^] The orginal idea was to assign as an icon the icon of System.Windows.Forms.ProgressBar but i have tried everything and I couldn't do it. So i decided to add a new icon. That also didn't work. Finally i decided to use the ToolBoxBitmap("FILEONDISK") constructor but that didn't work also. So two things are happening. 1)It doesn't work which is not probable 2)Something in testing is wrong. My test procedure has been. Cleaning the project, building in debug and then in a designer of a form looking the toolbox. Please if i'm doing something wrong tell me. Also If someone has the solution to pute the .net controls icon in mine please also tell me. Because it matters here are some details for the project Default namespace: MyComponents.Windows Assembly Name: MyComponents.Windows The control is located in Controls\ProgressBar.cs in the project dir MyComponents\Windows. Here is the class declaration { [ToolboxBitmap(typeof(ResourceFinder), "System.Windows.Forms.ProgressBar.bmp")] public class ProgressBar:System.Windows.Forms.Control ResourceFinder is an internal class outside Namespace declaration. As i have understood this should be sufficcient.

    F 1 Reply Last reply
    0
    • A aSarafian

      I have created my own custom progressbar controls and i wish to assign them an icon for the toolbox. I have read everything i found on the net including the super http://www.bobpowell.net/toolboxbitmap.htm[^] The orginal idea was to assign as an icon the icon of System.Windows.Forms.ProgressBar but i have tried everything and I couldn't do it. So i decided to add a new icon. That also didn't work. Finally i decided to use the ToolBoxBitmap("FILEONDISK") constructor but that didn't work also. So two things are happening. 1)It doesn't work which is not probable 2)Something in testing is wrong. My test procedure has been. Cleaning the project, building in debug and then in a designer of a form looking the toolbox. Please if i'm doing something wrong tell me. Also If someone has the solution to pute the .net controls icon in mine please also tell me. Because it matters here are some details for the project Default namespace: MyComponents.Windows Assembly Name: MyComponents.Windows The control is located in Controls\ProgressBar.cs in the project dir MyComponents\Windows. Here is the class declaration { [ToolboxBitmap(typeof(ResourceFinder), "System.Windows.Forms.ProgressBar.bmp")] public class ProgressBar:System.Windows.Forms.Control ResourceFinder is an internal class outside Namespace declaration. As i have understood this should be sufficcient.

      F Offline
      F Offline
      Fabio Zanetta
      wrote on last edited by
      #2

      You need also the [ToolboxItem(true)] attribute. In my tests for this I went crazy because it **seems** to work only if you reference the compiled dll and not with a reference to the project and this is not documented at all.


      free .net reporting and gdi+ tools www.neodatatype.net

      A 1 Reply Last reply
      0
      • F Fabio Zanetta

        You need also the [ToolboxItem(true)] attribute. In my tests for this I went crazy because it **seems** to work only if you reference the compiled dll and not with a reference to the project and this is not documented at all.


        free .net reporting and gdi+ tools www.neodatatype.net

        A Offline
        A Offline
        aSarafian
        wrote on last edited by
        #3

        This is what I'm using and still it doesn't work. internal class ResourceFinder { } namespace MyComponents.Windows.Controls { [ToolboxItem(true), ToolboxBitmap(typeof(ResourceFinder), "System.Windows.Forms.ProgressBar.bmp")] //[ToolboxBitmap(typeof(ResourceFinder), "System.Windows.Forms.ProgressBar.bmp")] public class ProgressBar:System.Windows.Forms.Control In the same solution there is the GUI in another project. O compile the control and VS2005 populates automatically the Toolbar. But the icon is wrong.

        F 1 Reply Last reply
        0
        • A aSarafian

          This is what I'm using and still it doesn't work. internal class ResourceFinder { } namespace MyComponents.Windows.Controls { [ToolboxItem(true), ToolboxBitmap(typeof(ResourceFinder), "System.Windows.Forms.ProgressBar.bmp")] //[ToolboxBitmap(typeof(ResourceFinder), "System.Windows.Forms.ProgressBar.bmp")] public class ProgressBar:System.Windows.Forms.Control In the same solution there is the GUI in another project. O compile the control and VS2005 populates automatically the Toolbar. But the icon is wrong.

          F Offline
          F Offline
          Fabio Zanetta
          wrote on last edited by
          #4

          Let's say that ResourceFinder is in the namespace MyDllNameSpace.Images, the default namespace of your assembly (see Assembly properties) is MyDllNameSpace, the bmp should be into Images subfolder (so that ResourceFinder namespace is equal to default namespace + bmp folder): ToolboxBitmap(typeof(ResourceFinder), "ProgressBar.bmp")]


          free .net reporting and gdi+ tools www.neodatatype.net

          1 Reply Last reply
          0
          Reply
          • Reply as topic
          Log in to reply
          • Oldest to Newest
          • Newest to Oldest
          • Most Votes


          • Login

          • Don't have an account? Register

          • Login or register to search.
          • First post
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • World
          • Users
          • Groups