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. WPF
  4. How to add simple C# user control to WPF project ?

How to add simple C# user control to WPF project ?

Scheduled Pinned Locked Moved WPF
csharpquestionwpftutorial
7 Posts 4 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
    Lost User
    wrote on last edited by
    #1

    I have some user control that i wrote in simple C# winform. I want to add it into WPF Window. How can i do it ? Thanks.

    K A P 3 Replies Last reply
    0
    • L Lost User

      I have some user control that i wrote in simple C# winform. I want to add it into WPF Window. How can i do it ? Thanks.

      K Offline
      K Offline
      Kunal Chowdhury IN
      wrote on last edited by
      #2

      Probably this is not possible. I never tried. The reason behind is, WPF UI is designed using XAML code, so if you want to use it as XAML code it will not work. In the other hand, from the code behind I am not sure. But I think, it will not work.

      Don't forget to Click on [Vote] and [Good Answer] on the posts that helped you.


      Regards - Kunal Chowdhury | Software Developer | Chennai | India | My Blog | My Tweets | Silverlight Tutorial

      L 1 Reply Last reply
      0
      • K Kunal Chowdhury IN

        Probably this is not possible. I never tried. The reason behind is, WPF UI is designed using XAML code, so if you want to use it as XAML code it will not work. In the other hand, from the code behind I am not sure. But I think, it will not work.

        Don't forget to Click on [Vote] and [Good Answer] on the posts that helped you.


        Regards - Kunal Chowdhury | Software Developer | Chennai | India | My Blog | My Tweets | Silverlight Tutorial

        L Offline
        L Offline
        Lost User
        wrote on last edited by
        #3

        Thanks, I already found how to do it. It is possible and its work fine. This can be done by using 'WindowsFormsIntegration' on the xaml. I found the example here[^]

        K 1 Reply Last reply
        0
        • L Lost User

          Thanks, I already found how to do it. It is possible and its work fine. This can be done by using 'WindowsFormsIntegration' on the xaml. I found the example here[^]

          K Offline
          K Offline
          Kunal Chowdhury IN
          wrote on last edited by
          #4

          Woh that's great. I was not aware of it. Actually I never worked with WinForm. Thanks for sharing the link.

          Don't forget to Click on [Vote] and [Good Answer] on the posts that helped you.


          Regards - Kunal Chowdhury | Software Developer | Chennai | India | My Blog | My Tweets | Silverlight Tutorial

          L 1 Reply Last reply
          0
          • K Kunal Chowdhury IN

            Woh that's great. I was not aware of it. Actually I never worked with WinForm. Thanks for sharing the link.

            Don't forget to Click on [Vote] and [Good Answer] on the posts that helped you.


            Regards - Kunal Chowdhury | Software Developer | Chennai | India | My Blog | My Tweets | Silverlight Tutorial

            L Offline
            L Offline
            Lost User
            wrote on last edited by
            #5

            :) i have some third party dll that can't work with WPF (just with winform)- so this is the reason i needed to do it.

            1 Reply Last reply
            0
            • L Lost User

              I have some user control that i wrote in simple C# winform. I want to add it into WPF Window. How can i do it ? Thanks.

              A Offline
              A Offline
              Abhinav S
              wrote on last edited by
              #6

              Can be possible - this might give you some ideas[^].

              The funniest thing about this particular signature is that by the time you realise it doesn't say anything it's too late to stop reading it. My latest tip/trick Visit the Hindi forum here.

              1 Reply Last reply
              0
              • L Lost User

                I have some user control that i wrote in simple C# winform. I want to add it into WPF Window. How can i do it ? Thanks.

                P Offline
                P Offline
                PumbaPumba
                wrote on last edited by
                #7

                Hi Yanshof, You can do this by using the WindowsFormHost

                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