C# Visual Studio 2010 Project C# WebBrowser
using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Text; using System.Windows.Forms; namespace WebBrowser { public partial class Form1 : Form { public Form1() { InitializeComponent(); } private void btnNavigate_Click(object sender, EventArgs e) { webBrowser1.Navigate(txtAddressBar.Text); } private void btnBack_Click(object sender, EventArgs e) { if (webBrowser1.CanGoBack == true) { webBrowser1.GoBack(); } } private void btnForward_Click(object sender, EventArgs e) { if (webBrowser1.CanGoForward == true) { webBrowser1.GoForward(); } } } }
VB.NET Visual Studio 2010 Project VB.NET WebBrowser
Public Class Form1 Private Sub btnNavigate_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnNavigate.Click WebBrowser1.Navigate(txtAddressBar.Text) End Sub Private Sub btnBack_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnBack.Click If WebBrowser1.CanGoBack Then WebBrowser1.GoBack() End If End Sub Private Sub btnFoward_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnFoward.Click If WebBrowser1.CanGoForward Then WebBrowser1.GoForward() End If End Sub End Class
Last Updated on March 3, 2016
You must be logged in to post a comment.