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. Make a component appear on the form at design time

Make a component appear on the form at design time

Scheduled Pinned Locked Moved C#
csharpvisual-studiodesigndockertutorial
3 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.
  • C Offline
    C Offline
    Christian Wikander
    wrote on last edited by
    #1

    I'm trying to make a component who's function can best be described as similar to the MainMenu component in VS.NET. The component should be able to add controls to the parent form at design time. Via code in the component, I can create the new control and add it to the same container as the component, thus making it visible in the properties window of the form (via the combobox in the properties window), but I can't seem to figure out how to make the control visible on the form. How can this be done?

    H 1 Reply Last reply
    0
    • C Christian Wikander

      I'm trying to make a component who's function can best be described as similar to the MainMenu component in VS.NET. The component should be able to add controls to the parent form at design time. Via code in the component, I can create the new control and add it to the same container as the component, thus making it visible in the properties window of the form (via the combobox in the properties window), but I can't seem to figure out how to make the control visible on the form. How can this be done?

      H Offline
      H Offline
      Hadi Fakhreddine
      wrote on last edited by
      #2

      If your component is a UserControl then you should have no problem seeing it on the form when you drop it from the toolbox. It acts as any other .NET built-in component. The component should be in a seperate project and should be a UserControl type.

      C 1 Reply Last reply
      0
      • H Hadi Fakhreddine

        If your component is a UserControl then you should have no problem seeing it on the form when you drop it from the toolbox. It acts as any other .NET built-in component. The component should be in a seperate project and should be a UserControl type.

        C Offline
        C Offline
        Christian Wikander
        wrote on last edited by
        #3

        The UserControl does not look the same as the MainMenu. As for the MainMenu the main component is the one that sits in the yellow field below the actual form. From that, several controls on the form are created, one for every MenuItem. I want to make a component (inherit from System.ComponentModel.Component) and by using code in the component I want to create several controls on the actual form at design time. Just like the MainMenu or the toolbar of VS 2005. The reason for this is that I want to manage several controls from one location, the component.

        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