Option Explicit
Private Sub Cmburl_Click()
On Error Resume Next
web.Navigate Cmburl.Text
Txturl.Text = Cmburl.Text
Cmdpreferiti.Enabled = False
End Sub
Private Sub Cmdgo_Click()
web.Navigate Txturl.Text
End Sub
Private Sub Cmdpreferiti_Click()
Dim f As Integer, m As Integer
Dim pref As String
f = FreeFile
m = FreeFile
Open App.Path & "\urls.txt" For Input As #m
While Not EOF(m)
Line Input #m, pref
If Trim(pref) = Trim(Txturl.Text) Then
MsgBox "Indirizzo già presente nella lista dei preferiti", vbExclamation, "Avviso"
Close #m
Exit Sub
End If
Wend
Close #m
Open App.Path & "\urls.txt" For Append As #f
If LCase(Left(Txturl.Text, 7)) <> "http://" Then
Print #f, "http://" & Txturl.Text
Else
Print #f, Txturl.Text
End If
Close #f
Cmburl.Clear
Call procedure.caricapreferiti
Cmburl.Text = Txturl.Text
End Sub
Private Sub Form_Load()
On Error Resume Next
If (Dir(App.Path & "\urls.txt")) = "" Then
Call procedure.inizio
End If
Call procedure.caricapreferiti
Call procedure.caricaimpostazioni
Call procedure.caricacensorwords
Cmburl.Text = Cmburl.List(0)
web.Navigate Txturl.Text
End Sub
Private Sub Form_Resize()
web.Width = Me.Width - 200
End Sub
Private Sub Tool_ButtonClick(ByVal Button As MSComctlLib.Button)
On Error Resume Next
Select Case Button.Index
Case 1
On Error Resume Next
Txturl.Text = web.LocationURL
web.GoBack
Case 2
On Error Resume Next
Txturl.Text = web.LocationURL
web.GoForward
Case 3
web.GoHome
web.Navigate home
Txturl.Text = home
Case 4
web.Stop
Case 5
web.Refresh
Case 6
web.GoSearch
Case 7
Frmimpostazioni.Show
Case 8
Txturl.Text = music
web.Navigate music
End Select
End Sub
Private Sub Txturl_Change()
If Txturl <> "" Then
Cmdpreferiti.Enabled = True
Cmdgo.Enabled = True
Else
Cmdgo.Enabled = False
Cmdpreferiti.Enabled = False
End If
End Sub
Private Sub Txturl_KeyPress(KeyAscii As Integer)
Dim i As Integer
On Error Resume Next
If KeyAscii = 13 Then
If filtro Then
For i = 1 To 2
If InStr(1, Txturl.Text, censura(i)) Then
MsgBox "La parola è stata censurata", vbInformation, "Censura"
Exit Sub
End If
Next i
End If
web.Navigate Txturl.Text
End If
End Sub
Private Sub web_ProgressChange(ByVal Progress As Long, ByVal ProgressMax As Long)
Stato.Panels(1).Text = web.LocationName & "--" & web.LocationURL
Frmbrowser.Caption = "Albert king explorer " & web.LocationName
End Sub