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. Sharing a winform

Sharing a winform

Scheduled Pinned Locked Moved C#
question
4 Posts 2 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.
  • S Offline
    S Offline
    StephenMcAllister
    wrote on last edited by
    #1

    I have several projects that make up part of a solution. What I would like to do is share two froms across two seperate projects. Is this possible and how? Thanks in advance. Stephen

    S 1 Reply Last reply
    0
    • S StephenMcAllister

      I have several projects that make up part of a solution. What I would like to do is share two froms across two seperate projects. Is this possible and how? Thanks in advance. Stephen

      S Offline
      S Offline
      S Senthil Kumar
      wrote on last edited by
      #2

      How about putting that form in a separate assembly and accessing it from your two projects? Regards Senthil _____________________________ My Blog | My Articles | WinMacro

      S 1 Reply Last reply
      0
      • S S Senthil Kumar

        How about putting that form in a separate assembly and accessing it from your two projects? Regards Senthil _____________________________ My Blog | My Articles | WinMacro

        S Offline
        S Offline
        StephenMcAllister
        wrote on last edited by
        #3

        OK. Sounds good but I have not done this before and i am new at C#. Have you a link to a sample or something? Thanks.

        S 1 Reply Last reply
        0
        • S StephenMcAllister

          OK. Sounds good but I have not done this before and i am new at C#. Have you a link to a sample or something? Thanks.

          S Offline
          S Offline
          S Senthil Kumar
          wrote on last edited by
          #4

          It's fairly simple. 1. Add a new "Class Library" project in your solution. 2. Drag and drop the form that is to be shared, into the new project. 3. Add references to the new project from the projects that need to use the form (Right click on the project in Solution Explorer, click Add References and go to the Projects tab). That should do the trick. Just make sure the shared form is under the same namespace, otherwise, you need to add a "using" directive. Regards Senthil _____________________________ My Blog | My Articles | WinMacro

          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