none
Hosting a WinForms control in a Transparent WPF Window... RRS feed

  • Question

  • Hi all-

    Is it possible to set a WPF window to Transparent (in order to customize the Window Chrome) and host a WinForms control within the window?  I am creating a theme currently, and want to customize the chrome in order to round the corners of the window, and change up the look and feel a bit.  One of the developers mentioned a possible .NET/XP bug though that may cause WinForms components to be hidden if placed in a transparent window.  Just wanted to see if this is the case, and if there are work arounds to this issue.

     

    Thanks for any help.

    Chris

     

    Monday, April 5, 2010 7:30 PM

Answers

All replies

  • Hosting Winforms controls in a WPF window is not a good idea.  The WinformsInterop object was clearly hacked in at the last second with poor quality control. It flashes a LOT.

     

    Monday, April 5, 2010 7:43 PM
  • Totally agree it is not a good idea, but pretty much all applications in house are doing this.  Just curious if people have seen the above before I even attempt to create a chrome.
    Monday, April 5, 2010 9:02 PM
  • You cannot do this. Child windows inside top-level windows with per-pixel alpha are not supported. This is a Win32 limitation, not a WPF one.
    Controls for WPF, Windows Forms and Silverlight at http://www.divelements.co.uk
    Monday, April 5, 2010 9:16 PM
  •  

    >You cannot do this. Child windows inside top-level windows with per-pixel alpha >are not supported. This is a Win32 limitation, not a WPF one.

    IN FACT... WPF allows you to do that while Win32 does not.

    Monday, April 5, 2010 10:47 PM
  • Wrong. WPF does not have child windows (in the Win32 sense) which is why purely WPF content can exist in such a window. It would be misleading to suggest that this is anything other than a Win32 issue.
    Controls for WPF, Windows Forms and Silverlight at http://www.divelements.co.uk
    Tuesday, April 6, 2010 8:26 AM