Basic Chromium Web Browser
Source Code
Imports CefSharp
Imports CefSharp.WinForms
Public Class Form1
Dim webb As New ChromiumWebBrowser()
Private Sub GoToolStripMenuItem_Click(sender As Object, e As EventArgs) Handles GoToolStripMenuItem.Click
chrome()
End Sub
Private Sub chrome()
webb.LoadUrl("https://" + ToolStripTextBox1.Text)
Panel1.Controls.Add(webb)
webb.Dock = DockStyle.Fill
End Sub
Private Sub GoBackToolStripMenuItem_Click(sender As Object, e As EventArgs) Handles GoBackToolStripMenuItem.Click
webb.Back()
End Sub
Private Sub GoForwardToolStripMenuItem_Click(sender As Object, e As EventArgs) Handles GoForwardToolStripMenuItem.Click
webb.Forward()
End Sub
Private Sub RefreshPageToolStripMenuItem_Click(sender As Object, e As EventArgs) Handles RefreshPageToolStripMenuItem.Click
webb.Refresh()
End Sub
Private Sub Form1_Load(sender As Object, e As EventArgs) Handles MyBase.Load
Start()
End Sub
Private Sub ToolStripTextBox1_KeyPress(sender As Object, e As KeyPressEventArgs) Handles ToolStripTextBox1.KeyPress
End Sub
Private Sub ToolStripTextBox1_KeyDown(sender As Object, e As KeyEventArgs) Handles ToolStripTextBox1.KeyDown
If e.KeyCode = Keys.Enter Then
chrome()
End If
End Sub
Private Sub Start()
webb.LoadUrl("https://www.google.com")
Panel1.Controls.Add(webb)
webb.Dock = DockStyle.Fill
End Sub
End Class
__________________________________________________________________________________________________________________________________
Target Framework: .Net Framework 4.5.2
Comments
Post a Comment