Questo sito utilizza cookies solo per scopi di autenticazione sul sito e nient'altro. Nessuna informazione personale viene tracciata. Leggi l'informativa sui cookies.
Username: Password: oppure
GN WebStudio - BrowserInterno.vb

BrowserInterno.vb

Caricato da: GN
Scarica il programma completo

  1. Imports System.Windows.Forms
  2.  
  3. Public Class BrowserInterno
  4.     Dim Tempo As Integer = 0
  5.     Private Sub OK_Button_Click(ByVal sender As System.Object, ByVal e As System.EventArgs)
  6.         Me.DialogResult = System.Windows.Forms.DialogResult.OK
  7.         Me.Close()
  8.     End Sub
  9.  
  10.     Private Sub Cancel_Button_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Cancel_Button.Click
  11.         Me.DialogResult = System.Windows.Forms.DialogResult.Cancel
  12.         Me.Close()
  13.     End Sub
  14.  
  15.     Private Sub TimerCaricamento_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles TimerCaricamento.Tick
  16.         Tempo += 1
  17.     End Sub
  18.  
  19.     Private Sub Browser_DocumentCompleted(ByVal sender As System.Object, ByVal e As System.Windows.Forms.WebBrowserDocumentCompletedEventArgs) Handles Browser.DocumentCompleted
  20.         TimerCaricamento.Stop()
  21.         Dim DettagliTempo As New TimeSpan(0, 0, 0, 0, Tempo)
  22.         TempoCaricamento.Text = "Tempo di caricamento della pagina: " & DettagliTempo.Minutes & "m " & DettagliTempo.Seconds & "s " & DettagliTempo.Milliseconds & "ms"
  23.         txtURL.Text = Browser.Url.ToString()
  24.     End Sub
  25.  
  26.     Private Sub Browser_FileDownload(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Browser.FileDownload
  27.         Tempo = 0
  28.         TimerCaricamento.Start()
  29.     End Sub
  30.  
  31.     Private Sub Indietro_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Indietro.Click
  32.         Browser.GoBack()
  33.     End Sub
  34.  
  35.     Private Sub btnAvanti_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnAvanti.Click
  36.         Browser.GoForward()
  37.     End Sub
  38.  
  39.     Private Sub btnHome_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnHome.Click
  40.         Dim FileCorr As String = MainForm.SitoCorr & "/index.htm"
  41.         If My.Computer.FileSystem.FileExists(FileCorr) = True Then
  42.             Browser.Navigate(FileCorr)
  43.         Else
  44.             Browser.Navigate(MainForm.SitoCorr & "/index.html")
  45.         End If
  46.     End Sub
  47.  
  48.     Private Sub btnVai_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnVai.Click
  49.         Browser.Navigate(txtURL.Text)
  50.     End Sub
  51. End Class