Langkah pertama yang harus disiapkan tentu saja Software Visual Basic 6.0 yang portable maupun yang tidak. kalau belum punya silahkan searching di mbah google.
selanjutnya buat form dengan nama terserah anda, kemudian tekan CTRL+T atau Pilih menu Project > Componet setelah itu pilihlah komponen seprti di bawah ini :
# Microsoft HTML Library
# Microsoft Internet Control
# Microsoft Windows Common Control 6.0
kemudian Klik apply
Setelah itu siapkan
- 2 Label
- 1 Text box
- 6 Button
- 1 Webbrowser
- 1 Progress Bar
Untuk Button Back :
Private Sub back_Click()
On Error Resume Next
WebBrowser1.GoBack
End Sub
Untuk Button Go :
Private Sub Command1_Click()
On Error Resume Next
WebBrowser1.Navigate (Text1.Text)
End Sub
Private Sub Command1_Click()
On Error Resume Next
WebBrowser1.Navigate (Text1.Text)
End Sub
Untuk Button Exit :
Private Sub exit_Click()
Unload Me
End Sub
Private Sub exit_Click()
Unload Me
End Sub
Untuk Button Forward :
Private Sub forward_Click()
On Error Resume Next
WebBrowser1.GoForward
End Sub
Private Sub forward_Click()
On Error Resume Next
WebBrowser1.GoForward
End Sub
Untuk Button Home :
Private Sub home_Click()
On Error Resume Next
WebBrowser1.GoHome
End Sub
Private Sub home_Click()
On Error Resume Next
WebBrowser1.GoHome
End Sub
Kode untuk web browser :
Private Sub WebBrowser1_ProgressChange(ByVal Progress As Long, ByVal ProgressMax As Long)
On Error Resume Next
If Progress = -1 Then ProgressBar1.Value = 100
Label1.Caption = "Done"
ProgressBar1.Visible = False
If Progress > 0 And ProgressMax > 0 Then
ProgressBar1.Visible = True
Image1.Visible = False
ProgressBar1.Value = Progress * 100 / ProgressMax
Label1.Caption = "Loading... " & Int(Progress * 100 / ProgressMax) & "%"
End If
Exit Sub
End Sub
Private Sub WebBrowser1_ProgressChange(ByVal Progress As Long, ByVal ProgressMax As Long)
On Error Resume Next
If Progress = -1 Then ProgressBar1.Value = 100
Label1.Caption = "Done"
ProgressBar1.Visible = False
If Progress > 0 And ProgressMax > 0 Then
ProgressBar1.Visible = True
Image1.Visible = False
ProgressBar1.Value = Progress * 100 / ProgressMax
Label1.Caption = "Loading... " & Int(Progress * 100 / ProgressMax) & "%"
End If
Exit Sub
End Sub
Untuk Button Refresh :
Private Sub refresh_Click()
On Error Resume Next
WebBrowser1.refresh
End Sub
Private Sub refresh_Click()
On Error Resume Next
WebBrowser1.refresh
End Sub
Kemudian langkah terakhir adalah menjalankan program yang sudah di buat.
Rating:
100%
based on 10 ratings.
5 user reviews.
mengapa Private Sub Command1_Click selalu slaha
ReplyDelete