Files
docs-desktop/dotnet-desktop-guide/framework/winforms/controls/how-to-add-web-browser-capabilities-to-a-windows-forms-application.md
Andy De George c0ba284473 Initial winforms content migrated (#18)
* Merge winforms framework content to working branch (#14)

* Breadcrumb / TOC / Move net5 to net folder (#15)

* change path from net5 to net

* Mess with bread/toc

* Mess with bread/toc

* Mess with bread/toc

* Mess with bread/toc

* Mess with bread/toc

* Mess with bread/toc

* Mess with bread/toc

* Mess with bread/toc

* Mess with bread/toc

* Mess with bread/toc

* Mess with bread/toc

* Mess with bread/toc

* Mess with bread/toc

* Mess with bread/toc

* Add .net 5 winforms placeholder article (#16)

* added some metadata and adjusted net5 placeholder

* corrections

* corrections

* corrections

* Test1

* Swapping landing page vs concept

* fix links

* Fix links

* Fix desc
2020-09-01 16:26:21 -07:00

2.2 KiB

title, description, ms.date, dev_langs, helpviewer_keywords, ms.assetid
title description ms.date dev_langs helpviewer_keywords ms.assetid
Add web browser capabilities to app Learn how to add web browser capabilities to a Windows Forms application with the WebBrowser control. 03/30/2017
csharp
vb
cpp
WebBrowser control [Windows Forms], adding Web browser capabilities to your application
WebBrowser control [Windows Forms], examples
Web browsers [.NET Framework], adding to Windows Forms
examples [Windows Forms], WebBrowser control
Windows Forms, adding Web browser functionality
3871f072-b57a-435b-9976-e5da28df04a7

How to add web browser capabilities to a Windows Forms application

With the xref:System.Windows.Forms.WebBrowser control, you can add Web browser functionality to your application. The control works like a Web browser by default. After you load an initial URL by setting the xref:System.Windows.Forms.WebBrowser.Url%2A property, you can navigate by clicking hyperlinks or by using keyboard shortcuts to move backward and forward through navigation history. By default, you can access additional browser functionality through the right-click shortcut menu. You can also open new documents by dropping them onto the control. The xref:System.Windows.Forms.WebBrowser control also has several properties, methods, and events that you can use to implement user interface features similar to those found in Internet Explorer.

The following code example implements an address bar, typical browser buttons, a File menu, a status bar, and a title bar that displays the current page title.

Example

[!code-cppSystem.Windows.Forms.WebBrowser#0] [!code-csharpSystem.Windows.Forms.WebBrowser#0] [!code-vbSystem.Windows.Forms.WebBrowser#0]

Compile the code

This example requires:

  • References to the System, System.Drawing, and System.Windows.Forms assemblies.

See also