.NET Framework Bookmark and Share   
 index > Windows Presentation Foundation (WPF) > WindowsFormsHost z-order
 

WindowsFormsHost z-order

Hi,

Ineeded to show html content inside my WPF screen. I took WindowsFormsHost and put WinForms' WebBrowser inside. It was amazingly simple.

Then I added a panel with progress bar to my screen and wanted to display itin front to show progress of some operation. But the panel was always behind the web browser ! I understand what is going on, the web browser is a real Win32 window, a child of WPF rendering window. Any WPF content will always be behind child windows.

I see two solutions:

- Create another WPF rendering window and show it in front of main WPF with webbrowser. Transparency and focus become issues here.

- Take a snapshot of the webbrowser, hide webbrowser and show only the freezed snapshot. Good trick with obvious disadvantages.

Is there any example of these solutions available ? Does anybody know a better way ?

Or does any native way exist to show HTML content in WPF ?

Thanks for help.

Regards,

Jan

Jan10
Hi Jan

WinFormsIntegration content is always rendered after WPF content, therefore it always sits on top of the WPF content. You will also find performance is not great!

Fortunately you can natively host web content within a Frame, e.g.

<Frame Source="http://www.google.co.uk" />
Neil Mosafi
Hi Jan

WinFormsIntegration content is always rendered after WPF content, therefore it always sits on top of the WPF content. You will also find performance is not great!

Fortunately you can natively host web content within a Frame, e.g.

<Frame Source="http://www.google.co.uk" />
Neil Mosafi

Thanks Neil,

I didn't know Frame. But after a simple test it seems that web content is rendered on top of everything also in this case. They just took the same IE component and put it into Frame for html content. The window even has the ugly 3D gray border by default.

I'm a fan of XAML but Adobe's Apollo can render both html and pdf :-)

Regards,

Jan

Jan10

You can use google to search for other answers

Custom Search

More Threads

• Partial Collision detection or full Collision detection
• WPF .exe hyperlinks
• Problem with cliptobound
• Hosting WPF Designer
• viewmodel INotifyPropertyChanged question
• Scroll performance (Avalon and Office 12)
• Use Style In ControlTemplate
• exception in Program Output Window
• WPF animation and sound synch
• ListView Sorting issue (Defining the sortdescriptions in the viewmodel)