📄 frmmain.vb
字号:
AppManager.CurrentBrowser.ShowFindDialog()
End Sub
Private Sub lblSec_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles lblSec.Click
Dim ofrm As New frmSecInfo
ofrm.ShowDialog(Me)
End Sub
Private Sub mnuProperties_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles mnuProperties.Click
AppManager.CurrentBrowser.ShowPropertiesDialog()
End Sub
Private Sub mnuProperties2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles mnuProperties2.Click
Dim ofrm As New frmProperties
ofrm.obj = AppManager.CurrentBrowser.Document
ofrm.ShowDialog(Me)
End Sub
Private Sub mnuSecInfo_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles mnuSecInfo.Click
Dim ofrm As New frmSecInfo
ofrm.ShowDialog(Me)
End Sub
Private Sub mnuAbout_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles mnuAbout.Click
Dim ofrm As New frmAbout
ofrm.ShowDialog(Me)
End Sub
Private Sub mnuViewSource_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles mnuViewSource.Click
AppManager.CurrentBrowser.ShowSource()
End Sub
Private Sub mnuViewMenuBar_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles mnuViewMenuBar.Click
mnuViewMenu.PerformClick()
End Sub
Private Sub mnuViewStatusBar_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles mnuViewStatusBar.Click
mnuViewStatus.PerformClick()
End Sub
Private Sub HistoryToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles HistoryToolStripMenuItem.Click
Process.Start(Environment.GetFolderPath(Environment.SpecialFolder.History))
End Sub
Private Sub btnDocFav_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnDocFav.Click
Select Case btnDocFav.Tag
Case 1
gbFavs.Dock = DockStyle.Left
gbFavs.SendToBack()
btnDocFav.Image = My.Resources.Delete16
btnDocFav.Tag = 2
Case 2
gbFavs.Dock = DockStyle.None
btnDocFav.Image = My.Resources.favDock
gbFavs.BringToFront()
gbFavs.Visible = False
btnDocFav.Tag = 1
End Select
End Sub
Private Sub mnuSettings_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles mnuSettings.Click
Dim ofrm As New frmSettings
ofrm.ShowDialog(Me)
End Sub
Private Sub btnRSS_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnRSS.Click
Dim ofrm As New frmRSS
tc1.TabPages.Add(ofrm)
End Sub
Private Sub mnuPageSetup_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles mnuPageSetup.Click
AppManager.CurrentBrowser.ShowPageSetupDialog()
End Sub
Private Sub mnuPrint_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles mnuPrint.Click
AppManager.CurrentBrowser.ShowPrintDialog()
End Sub
Private Sub mnuPrintPreview_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles mnuPrintPreview.Click
AppManager.CurrentBrowser.ShowPrintPreviewDialog()
End Sub
Private Sub mnuFProperties_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles mnuFProperties.Click
AppManager.CurrentBrowser.ShowPropertiesDialog()
End Sub
Private Sub mnuSaveAs_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles mnuSaveAs.Click
AppManager.CurrentBrowser.ShowSaveAsDialog()
End Sub
Private Sub mnuClose_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles mnuClose.Click
Me.Close()
End Sub
Private Sub mnuOpen_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles mnuOpen.Click
AppManager.CurrentBrowser.ShowOpen()
End Sub
Private Sub RSSViewerToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles RSSViewerToolStripMenuItem.Click
btnRSS.PerformClick()
End Sub
Private Sub InternetOptionsToolStripMenuItem1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles InternetOptionsToolStripMenuItem1.Click
AppManager.CurrentBrowser.ShowInternetOptions()
End Sub
Private Sub SettingsToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles SettingsToolStripMenuItem.Click
Dim ofrm As New frmSettings
ofrm.ShowDialog(Me)
End Sub
Private Sub PropertiesToolStripMenuItem1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles PropertiesToolStripMenuItem1.Click
AppManager.CurrentBrowser.ShowPropertiesDialog()
End Sub
Private Sub mnuLeftToRight_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles mnuLeftToRight.Click
AppManager.CurrentBrowser.Document.RightToLeft = False
mnuRightToLeft.Checked = False
End Sub
Private Sub mnuRightToLeft_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles mnuRightToLeft.Click
AppManager.CurrentBrowser.Document.RightToLeft = True
mnuLeftToRight.Checked = False
End Sub
Private Sub btnFeeds_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnFeeds.Click
Dim ofrm As New frmRSS
Me.tc1.TabPages.Add(ofrm)
gbFavs.Visible = False
End Sub
Private Sub btnHistory_ButtonClick(ByVal sender As System.Object, ByVal e As System.EventArgs)
Dim ofrm As New frmBrowser
AppManager.AddTab(ofrm, Environment.GetFolderPath(Environment.SpecialFolder.History))
gbFavs.Visible = False
End Sub
#End Region
#Region " Tab Control "
Private Sub tc1_SelectedTabChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles tc1.SelectedTabChanged
On Error Resume Next
Dim cForm As Form = tc1.SelectedForm
If TypeOf cForm Is frmBrowser Then
Dim ofrm As frmBrowser = cForm
Me.Text = cForm.Text & " - " & My.Resources.AppName
cboURL.Text = ofrm.wb.Url.ToString
AppManager.CurrentBrowser = ofrm.wb
btnBack.Enabled = AppManager.CurrentBrowser.CanGoBack
btnForward.Enabled = AppManager.CurrentBrowser.CanGoForward
If ofrm.NumFeeds = 0 Then
mnuFeeds.Enabled = False
Else
mnuFeeds.Enabled = True
End If
Else
'Nothing to do
End If
End Sub
#Region " Legacy Code "
'The author of our tab control was kind enough to send an update on this control
'So this code is not longer needed.
'Private Sub tc1_OnSelectedTabChanged(ByVal e As System.Windows.Forms.Form) Handles tc1.OnSelectedTabChanged
' SetBrowser(e)
'End Sub
'Private Sub SetBrowser(ByVal cForm As Form)
' On Error Resume Next
' If TypeOf cForm Is frmBrowser Then
' Dim ofrm As frmBrowser = cForm
' Me.Text = cForm.Text & " - " & My.Resources.AppName
' cboURL.Text = ofrm.wb.Url.ToString
' AppManager.CurrentBrowser = ofrm.wb
' btnBack.Enabled = AppManager.CurrentBrowser.CanGoBack
' btnForward.Enabled = AppManager.CurrentBrowser.CanGoForward
' Else
' End If
'End Sub
#End Region
#End Region
Private Sub mnuGrabImages_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles mnuGrabImages.Click
Dim ofrm As New frmScrapeImages
ofrm.ShowDialog(AppManager.MainForm)
End Sub
Private Sub PropertiesToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles PropertiesToolStripMenuItem.Click
tFileInfo.ShowProp(fitm.Tag)
End Sub
Private Sub DeleteToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles DeleteToolStripMenuItem.Click
If MessageBox.Show("Are you sure you want to delete " & fitm.Text & "?", "Confirm Delete", MessageBoxButtons.YesNoCancel, MessageBoxIcon.Question) = Windows.Forms.DialogResult.Yes Then
File.Delete(fitm.Tag)
tbLinks.Items.Remove(fitm)
End If
End Sub
Private Sub OpenToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles OpenToolStripMenuItem.Click
Dim obj As New tlxIni(fitm.Tag)
AppManager.CurrentBrowser.Navigate(obj.GetString("INTERNETSHORTCUT", "URL", String.Empty))
End Sub
Private Sub RenameToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles RenameToolStripMenuItem.Click
Dim fInfo As New FileInfo(fitm.Tag)
Dim NewName As String = InputBox("Rename " & fitm.Text, "Rename Favorite", fitm.Text)
File.Copy(fitm.Tag, fInfo.Directory.ToString & "\" & NewName & ".url")
File.Delete(fitm.Tag)
fitm.Text = NewName
fitm.Tag = fInfo.Directory.ToString & "\" & NewName & ".url"
End Sub
Private Sub mnuCheckFeeds_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles mnuCheckFeeds.Click
Dim ofrm As New frmDetectRSS
ofrm.ShowDialog(Me)
End Sub
Private Sub btnHistory_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnHistory.Click
Dim ofrm As New frmHistory
ofrm.LoadMode = frmHistory.LoadModes.History
ofrm.Text = "History Viewer"
tc1.TabPages.Add(ofrm)
gbFavs.Visible = False
End Sub
Private Sub btnViewCookies_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnViewCookies.Click
Dim ofrm As New frmCookieViewer
tc1.TabPages.Add(ofrm)
gbFavs.Visible = False
End Sub
Private Sub mnuCache_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles mnuHistory.Click
Dim ofrm As New frmHistory
ofrm.LoadMode = frmHistory.LoadModes.History
ofrm.Text = "History Viewer"
tc1.TabPages.Add(ofrm)
gbFavs.Visible = False
End Sub
Private Sub mnuTempFiles_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles mnuTempFiles.Click
Dim ofrm As New frmHistory
ofrm.LoadMode = frmHistory.LoadModes.Cache
ofrm.Text = "Cache Viewer"
tc1.TabPages.Add(ofrm)
gbFavs.Visible = False
End Sub
Private Sub mnuAllWindows_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles mnuAllWindows.Click
Dim ofrm As New frmAllBrowsers
tc1.TabPages.Add(ofrm)
End Sub
Private Sub mnuFeeds_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles mnuFeeds.Click
Dim ofrm As New frmDetectRSS
ofrm.ShowDialog(Me)
End Sub
End Class
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -