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. Windows Forms
  4. Windows Form as Control in DLL

Windows Form as Control in DLL

Scheduled Pinned Locked Moved Windows Forms
csharphtmltutorial
8 Posts 3 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.
  • M Offline
    M Offline
    Mike Kitchen
    wrote on last edited by
    #1

    I'm not sure whether this can be achieved, but here goes. I have created a new color dialog for a simple html editor. I would like to packeage the form into a dll, so that when added to a project, the dialog appears in the toolbox. I am using C# express 2005. I can achieve this when creating a normal control but I am stumped when it comes to having a form in the dll instead. If anyone has any ideas as to how to achieve this, or even a small demo, I would be truly grateful.

    D 1 Reply Last reply
    0
    • M Mike Kitchen

      I'm not sure whether this can be achieved, but here goes. I have created a new color dialog for a simple html editor. I would like to packeage the form into a dll, so that when added to a project, the dialog appears in the toolbox. I am using C# express 2005. I can achieve this when creating a normal control but I am stumped when it comes to having a form in the dll instead. If anyone has any ideas as to how to achieve this, or even a small demo, I would be truly grateful.

      D Offline
      D Offline
      DigiOz Multimedia
      wrote on last edited by
      #2

      This is actually done quite frequently. It wouldn't be a Control in the DLL, but rather a Windows Form in the DLL, which you can initialize and invoke just like you would with any other form outside of the DLL.

      Pete Soheil DigiOz Multimedia http://www.digioz.com

      M 1 Reply Last reply
      0
      • D DigiOz Multimedia

        This is actually done quite frequently. It wouldn't be a Control in the DLL, but rather a Windows Form in the DLL, which you can initialize and invoke just like you would with any other form outside of the DLL.

        Pete Soheil DigiOz Multimedia http://www.digioz.com

        M Offline
        M Offline
        Mike Kitchen
        wrote on last edited by
        #3

        Hi, Yes I can do this. What I want to achieve, is see the form like the current colordialog in the toolbox to the side of the design window.

        D L 2 Replies Last reply
        0
        • M Mike Kitchen

          Hi, Yes I can do this. What I want to achieve, is see the form like the current colordialog in the toolbox to the side of the design window.

          D Offline
          D Offline
          DigiOz Multimedia
          wrote on last edited by
          #4

          Mike Kitchen wrote:

          Hi, Yes I can do this. What I want to achieve, is see the form like the current colordialog in the toolbox to the side of the design window.

          In design view, just right-click on the Toolbar, choose "Add/Remove Items" and select your custom library that contains your control. You can only do this for custom controls though, not for actual forms.

          Pete Soheil DigiOz Multimedia http://www.digioz.com

          1 Reply Last reply
          0
          • M Mike Kitchen

            Hi, Yes I can do this. What I want to achieve, is see the form like the current colordialog in the toolbox to the side of the design window.

            L Offline
            L Offline
            led mike
            wrote on last edited by
            #5

            Mike Kitchen wrote:

            like the current colordialog in the toolbox to the side of the design window.

            Then you need two things. You need the custom control with a designer implementation so it can be in the toolbox and dropped on a form by a developer. The interface (API) you create for the control supplies the mechanism that is used at runtime to launch the Windows Form that is also in the assembly (or in another assembly I suppose).

            M 1 Reply Last reply
            0
            • L led mike

              Mike Kitchen wrote:

              like the current colordialog in the toolbox to the side of the design window.

              Then you need two things. You need the custom control with a designer implementation so it can be in the toolbox and dropped on a form by a developer. The interface (API) you create for the control supplies the mechanism that is used at runtime to launch the Windows Form that is also in the assembly (or in another assembly I suppose).

              M Offline
              M Offline
              Mike Kitchen
              wrote on last edited by
              #6

              OK. I am being a bit slow with this. So could you point me in the right direction to achieve this please. If I get it sorted I will post the dialog as an article.

              L 1 Reply Last reply
              0
              • M Mike Kitchen

                OK. I am being a bit slow with this. So could you point me in the right direction to achieve this please. If I get it sorted I will post the dialog as an article.

                L Offline
                L Offline
                led mike
                wrote on last edited by
                #7

                I doubt you will find an example of doing exactly what you intend. You need to piece the inforamtion together. I suggest you first learn how to create a custom control. That's pretty simple but then you need to learn about implementing the Visual Studio designer support. From there you should be able to see how your non windowed control is used by a developer to implement the showing of the form that is in the assembly. My original post contains the key words you would use in google to start researching, something like: MSDN Windows Forms custom control designer

                M 1 Reply Last reply
                0
                • L led mike

                  I doubt you will find an example of doing exactly what you intend. You need to piece the inforamtion together. I suggest you first learn how to create a custom control. That's pretty simple but then you need to learn about implementing the Visual Studio designer support. From there you should be able to see how your non windowed control is used by a developer to implement the showing of the form that is in the assembly. My original post contains the key words you would use in google to start researching, something like: MSDN Windows Forms custom control designer

                  M Offline
                  M Offline
                  Mike Kitchen
                  wrote on last edited by
                  #8

                  Hi Yep, started doing a few google searches and I have come up with a few links, so hopefully I am on my way with it now. Thanks for the help, and if I get it sorted I will post the control as an article.

                  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