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
CODE PROJECT For Those Who Code
  • Home
  • Articles
  • FAQ
Community
  1. Home
  2. General Programming
  3. C#
  4. Adding bitmap icon for custom toolbox component

Adding bitmap icon for custom toolbox component

Scheduled Pinned Locked Moved C#
graphicshardwarequestionlearning
5 Posts 4 Posters 1 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.
  • K Offline
    K Offline
    kanchoette
    wrote on last edited by
    #1

    I have created a 16-colour 16 x 16 pixel bitmap (.bmp) file which is named the same as my custom component. The bitmap is added to the solution as an embedded resource. In the code I have added the ToolBoxBitmap attribute prior to my component class: [ToolboxBitmap(typeof(MultiColumnComboBox))] [Designer(typeof(MultiColumnComboBoxDesigner))] public partial class MultiColumnComboBox : ComboBox { .... } but I still get the standard 'gear' icon showing in the toolbox after compilation. What am I doing wrong please?

    D M M 3 Replies Last reply
    0
    • K kanchoette

      I have created a 16-colour 16 x 16 pixel bitmap (.bmp) file which is named the same as my custom component. The bitmap is added to the solution as an embedded resource. In the code I have added the ToolBoxBitmap attribute prior to my component class: [ToolboxBitmap(typeof(MultiColumnComboBox))] [Designer(typeof(MultiColumnComboBoxDesigner))] public partial class MultiColumnComboBox : ComboBox { .... } but I still get the standard 'gear' icon showing in the toolbox after compilation. What am I doing wrong please?

      D Offline
      D Offline
      DaveyM69
      wrote on last edited by
      #2

      I've never got it to work reliably unless I put the component in a seperate assembly - then it magically displays perfectly.

      Dave
      BTW, in software, hope and pray is not a viable strategy. (Luc Pattyn)
      Visual Basic is not used by normal people so we're not covering it here. (Uncyclopedia)

      1 Reply Last reply
      0
      • K kanchoette

        I have created a 16-colour 16 x 16 pixel bitmap (.bmp) file which is named the same as my custom component. The bitmap is added to the solution as an embedded resource. In the code I have added the ToolBoxBitmap attribute prior to my component class: [ToolboxBitmap(typeof(MultiColumnComboBox))] [Designer(typeof(MultiColumnComboBoxDesigner))] public partial class MultiColumnComboBox : ComboBox { .... } but I still get the standard 'gear' icon showing in the toolbox after compilation. What am I doing wrong please?

        M Offline
        M Offline
        Mirko1980
        wrote on last edited by
        #3

        Apparently, Visual Studio doesn't show icons for toolbox component that are loaded automatically from project present on the solution. If you add manually your component to the toolbox (by using 'Choose Toolbox Item' and loadin the assembly containing the control) you shound see the icon.

        K 1 Reply Last reply
        0
        • M Mirko1980

          Apparently, Visual Studio doesn't show icons for toolbox component that are loaded automatically from project present on the solution. If you add manually your component to the toolbox (by using 'Choose Toolbox Item' and loadin the assembly containing the control) you shound see the icon.

          K Offline
          K Offline
          kanchoette
          wrote on last edited by
          #4

          Yep, that did it! Many thanks guys.

          1 Reply Last reply
          0
          • K kanchoette

            I have created a 16-colour 16 x 16 pixel bitmap (.bmp) file which is named the same as my custom component. The bitmap is added to the solution as an embedded resource. In the code I have added the ToolBoxBitmap attribute prior to my component class: [ToolboxBitmap(typeof(MultiColumnComboBox))] [Designer(typeof(MultiColumnComboBoxDesigner))] public partial class MultiColumnComboBox : ComboBox { .... } but I still get the standard 'gear' icon showing in the toolbox after compilation. What am I doing wrong please?

            M Offline
            M Offline
            MadArtSoft
            wrote on last edited by
            #5

            From the project you always will see the gear bitmap. Try to use option from toolbox for insert items. Then it should works.

            C# controls, .Net components. Help Desk Software

            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