How to use WebKit browser control in WPF

I want to use WebKit browser control in my WPF application. However, I cannot add it during development. Even if I add WebKit to the toolbar, this state is disabled.

My question is how to use this control during development in WPF form?

Thanks, Omkar

+5
source share
3 answers

As explained at http://msdn.microsoft.com/en-us/library/ms742735(v=vs.110).aspx , you must first create a WPF grid in your XAML file.

<Grid x:Name="grdBrowserHost">
</Grid>

And add .NET WebKit to your WPF form by pasting this code into your C # source.

System.Windows.Forms.Integration.WindowsFormsHost host =new System.Windows.Forms.Integration.WindowsFormsHost();

// Create the ActiveX control.
WebKit.WebKitBrowser browser = new WebKit.WebKitBrowser();
browser.Navigate("http://www.google.com");

// Assign the ActiveX control as the host control child.
host.Child = browser;

// Add the interop host control to the Grid 
// control collection of child controls. 
grdBrowserHost.Children.Add(host);

Remember to include these links

System.Windows.Forms

WindowsFormsIntegration

in your project.

.

+2

Webkit ( Blink) WPF ( 2017 ), , Awesomium, - , WinForms WPF.

- System.Windows.Forms.Integration.WindowsFormsHost WPF, , , DPI - , ,

, Awseomium open-source Free Software. $100 . . , $2900 .

, Awesomium WPF :

  • Awesomium SDK. ( 2017 . Awesomium , SDK - - ).
  • SDK Awesomium GAC , " " WPF ( WinForms).
  • WPF Visual Studio XAML.
  • Visual Studio "/ " Awesomeium WPF Awesomium.Windows.Controls.dll, GAC. , WebControl (Awesomium.Windows.Controls.WebControl).
  • - Visual Studio , Awesomeium.

, Chromium - Awesomium , , .

Another popular CefSharp library , which is licensed by BSD, will be more acceptable than Awesomium, but (as far as I can tell) it doesn’t distribute the SDK installer that handles the integration of the Visual Studio Toolbox for you, but it looks like you only need to manually add the link to Build CefSharp.Wpf.dlland add elements to your WPF project (using the XAML editor, not the Toolbox - which you should do anyway).

0
source

All Articles