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. How can I add control's icon on VS IDE's toolbox

How can I add control's icon on VS IDE's toolbox

Scheduled Pinned Locked Moved C#
visual-studioquestiongame-dev
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.
  • L Offline
    L Offline
    Libra
    wrote on last edited by
    #1

    I develop a dialog inherit ..Form and then make it to a DLL file. but I can not add this dialog's icon in toolbox, it said had none componets needed to add on the toolbox. I change this class inherit in ..Controls or in System.ComponentModel then it can add a icon which like a gear wheel, but if it inherit by ..Form then it can't work. My target want to build a dialog component like ..PrintDialog that it can show icon on toolbox and can drag to nonvisible component area. I wonder if ..Form's designer prevent the inherit form component add as a control..., but why ..PrintDialog which inherit by ..Form can? :confused: === Game is power! ===

    L 1 Reply Last reply
    0
    • L Libra

      I develop a dialog inherit ..Form and then make it to a DLL file. but I can not add this dialog's icon in toolbox, it said had none componets needed to add on the toolbox. I change this class inherit in ..Controls or in System.ComponentModel then it can add a icon which like a gear wheel, but if it inherit by ..Form then it can't work. My target want to build a dialog component like ..PrintDialog that it can show icon on toolbox and can drag to nonvisible component area. I wonder if ..Form's designer prevent the inherit form component add as a control..., but why ..PrintDialog which inherit by ..Form can? :confused: === Game is power! ===

      L Offline
      L Offline
      LongRange Shooter
      wrote on last edited by
      #2

      It is handled in the class attributes. [ToolboxItem(true), ToolboxBitmap(typeof(myControl), "myControl.bmp")] public class myControl:UserControl You need to have Default Namespace set to the namespace of your control and you have to have the bitmap in the root of your solution. There are 10 kinds of people in the world.
      Those that read binary...
      ...and those who don't.

      L 1 Reply Last reply
      0
      • L LongRange Shooter

        It is handled in the class attributes. [ToolboxItem(true), ToolboxBitmap(typeof(myControl), "myControl.bmp")] public class myControl:UserControl You need to have Default Namespace set to the namespace of your control and you have to have the bitmap in the root of your solution. There are 10 kinds of people in the world.
        Those that read binary...
        ...and those who don't.

        L Offline
        L Offline
        Libra
        wrote on last edited by
        #3

        At first, thanks for you help.:rose: I do what you said, it works well, the icon that can be showed on toolbox. But when I drag the icon to the designer area and then can not see it. it can not shows on 'nonvisible component area'(a bar at the bottom of designer), say nothing of 'visible area'. (But funny is it can be selected the component at the Property card :( ) === Game is power! ===

        L 1 Reply Last reply
        0
        • L Libra

          At first, thanks for you help.:rose: I do what you said, it works well, the icon that can be showed on toolbox. But when I drag the icon to the designer area and then can not see it. it can not shows on 'nonvisible component area'(a bar at the bottom of designer), say nothing of 'visible area'. (But funny is it can be selected the component at the Property card :( ) === Game is power! ===

          L Offline
          L Offline
          Libra
          wrote on last edited by
          #4

          Haha, I found it myself.;) Make this class attributes will be ok. [DesignTimeVisible(true)] [ToolboxItem(true), ToolboxBitmap(typeof(myDialog), "myDialog.bmp")] public class myDialog : System.Windows.Forms.Form :cool::cool::cool: === Game is power! ===

          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