A
A
Alexander Zaitsev2014-02-27 18:49:09
WPF
Alexander Zaitsev, 2014-02-27 18:49:09

How to place an object of the WebBrowser class on a WPF window?

There is a WPF window, through the constructor to which an object of the WebBrowser class was passed. How to place this object on a WPF window?

Answer the question

In order to leave comments, you need to log in

4 answer(s)
A
Alexander Zaitsev, 2014-02-28
@nithrous

I found an error. The matter is that there is System.Windows.Forms.WebBrowser, and there is System.Windows.Controls.WebBrowser and they cannot replace each other. That's why I couldn't add a browser via myGrid.Children.Add. thanks for answers

P
p0midor, 2014-02-27
@p0midor

Mb in the xaml'a graphical editor to drag the WebBrowser object from the toolbox to the window layout?

A
Alexander Zaitsev, 2014-02-27
@nithrous

In this case, a new control is created, not from an object. I need a second case

M
Mikhail Doshevsky, 2014-02-28
@MikhailD

The window has a Content property that contains the root layout, which can be, for example, Grid. You can add a WebBrowser to this layout:
myGrid.Children.Add(myWebBrowser);

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question