📄 form1.vb
字号:
Public Class Form1
Function loadweb()
x = x + 1
Dim DB As New OleDb.OleDbConnection
Dim DBC As New OleDb.OleDbCommand
DB.ConnectionString = "Provider=Microsoft.Jet.Oledb.4.0;Data Source=" & Mid(Application.ExecutablePath, 1, InStrRev(Application.ExecutablePath, "\")) & "webbrowser.mdb"
DB.Open()
DBC.Connection = DB
DBC.CommandText = "insert into mybrowser values('" & x & "','" & TextBox1.Text & "')"
DBC.ExecuteNonQuery()
DB.Close()
WebBrowser1.Navigate(TextBox1.Text)
End Function
Public x As Integer
' Private Sub Form1_FormClosing(ByVal sender As Object, ByVal e As System.Windows.Forms.FormClosingEventArgs) Handles Me.FormClosing
'Dim DB As New OleDb.OleDbConnection
'Dim DBC As New OleDb.OleDbCommand
' DB.ConnectionString = "Provider=Microsoft.Jet.Oledb.4.0;Data Source=" & Mid(Application.ExecutablePath, 1, InStrRev(Application.ExecutablePath, "\")) & "webbrowser.mdb"
' DB.Open()
'DBC.Connection = DB
'DBC.CommandText = "delete * from mybrowser"
'DBC.ExecuteNonQuery()
'DB.Close()
'End Sub
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
End Sub
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
WebBrowser1.Navigate(TextBox1.Text)
End Sub
Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs)
WebBrowser1.GoBack()
TextBox1.Text = WebBrowser1.StatusText
End Sub
Private Sub TextBox1_KeyUp(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyEventArgs) Handles TextBox1.KeyUp
If TextBox1.Text <> "" And e.KeyCode = Keys.Enter Then WebBrowser1.Navigate(TextBox1.Text)
End Sub
Private Sub TextBox1_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles TextBox1.TextChanged
End Sub
Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs)
WebBrowser1.GoForward()
TextBox1.Text = WebBrowser1.StatusText
End Sub
Private Sub WebBrowser1_DocumentCompleted(ByVal sender As System.Object, ByVal e As System.Windows.Forms.WebBrowserDocumentCompletedEventArgs) Handles WebBrowser1.DocumentCompleted
TextBox1.Text = WebBrowser1.Url.AbsoluteUri
End Sub
Private Sub WebBrowser1_Navigating(ByVal sender As Object, ByVal e As System.Windows.Forms.WebBrowserNavigatingEventArgs) Handles WebBrowser1.Navigating
TextBox1.Text = WebBrowser1.Url.AbsoluteUri
End Sub
Private Sub WebBrowser1_StatusTextChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles WebBrowser1.StatusTextChanged
StatusBar1.Text = "Status: " & WebBrowser1.StatusText
End Sub
Private Sub SaveAsToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles SaveAsToolStripMenuItem.Click
WebBrowser1.ShowSaveAsDialog()
End Sub
Private Sub ProprietiesToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ProprietiesToolStripMenuItem.Click
WebBrowser1.ShowPropertiesDialog()
End Sub
Private Sub NewToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles NewToolStripMenuItem.Click
WebBrowser1.Document.Window.OpenNew("", "")
End Sub
Private Sub ToolStripButton1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ToolStripButton1.Click
WebBrowser1.GoForward()
TextBox1.Text = WebBrowser1.StatusText
End Sub
Private Sub ToolStripButton2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ToolStripButton2.Click
WebBrowser1.GoBack()
TextBox1.Text = WebBrowser1.StatusText
End Sub
Private Sub ToolStripButton3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ToolStripButton3.Click
WebBrowser1.Stop()
End Sub
Private Sub ToolStripButton4_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ToolStripButton4.Click
WebBrowser1.Refresh()
End Sub
Private Sub AxCameraPreviewCtrl1_PreviewStarted(ByVal sender As System.Object, ByVal e As AxDSCameraPreviewCtrlLib._ICameraPreviewCtrlEvents_PreviewStartedEvent)
End Sub
End Class
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -