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. the wpf added winform controls

the wpf added winform controls

Scheduled Pinned Locked Moved WPF
questioncsharpwpfcom
3 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.
  • D Offline
    D Offline
    dengzn
    wrote on last edited by
    #1

    after put the control in wpf with winform, winform control in wpf control to cover What is the reason, should I do? picture

    P C 2 Replies Last reply
    0
    • D dengzn

      after put the control in wpf with winform, winform control in wpf control to cover What is the reason, should I do? picture

      P Offline
      P Offline
      Pete OHanlon
      wrote on last edited by
      #2

      I'm sorry, but I'm not clear what you're asking. I've looked at the picture and I can see that you have airspace issues there - is this what you are asking about? An airspace issue is where you try to overlay Winforms and WPF rendering or a web page and WPF rendering. This is a known issue with WPF (and will be fixed in the next release of WPF) because you are trying to combine rendering stacks - the fix is not to use a Windows Forms control. Find a WPF one that does what you want and use that, or write one yourself - it's generally not that hard.

      *pre-emptive celebratory nipple tassle jiggle* - Sean Ewington

      "Mind bleach! Send me mind bleach!" - Nagy Vilmos

      CodeStash - Online Snippet Management | My blog | MoXAML PowerToys | Mole 2010 - debugging made easier

      1 Reply Last reply
      0
      • D dengzn

        after put the control in wpf with winform, winform control in wpf control to cover What is the reason, should I do? picture

        C Offline
        C Offline
        Cracked Down
        wrote on last edited by
        #3

        There is a workaround which can be used to avoid this issue You need to wrap the WinformHost with UserControl of WPF. Follow these steps 1. Create a user control in the WPF (lookless control) 2. Create a style for this control 3. In the template of the style add WinformHost with x:name 4. Now override the OnApplyTemplate() of this control 5. Provide the .Child property of the Winformhost, added in the control template to the actual winform control that you want to display. Wrapping the winform control in the WPF control will avoid overlapping the WPF controls. This overlapping is due to difference in the mechanism for rendering control in WPF and Winforms. Winforms: uses GDI+ for rendering WPF: uses DirectX for rendering Hope this will help you to solve your problem Happy Coding :)

        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