Posted by : gerry alfarid Minggu, 08 September 2013
langsung aja siapkan bahannya :
- Visual Basic 6.0
Cara :
- Buka Visual Basic 6.0 yang udah didownload
- Buat 1 Project Baru
- Pilih Standard EXE
- Klik CTRL + T
- Maka akan ada tampilan seperti ini
- Pilih/Centang
a. Microsoft HTML Object Library
b. Microsoft Internet Control
c. Microsoft Windows Common Cotrol 6.0
- Klik Apply dan Klik Close
- Siapkan :
a. 2 label
b. 1 text box
c. 5 Command button
d. 1 WebBrowser
e. 1 Progress Bar
- Gue saranin Atur kayak gini :
- Ganti Captionnya : ( Command 1 : GO
Command 2 : Kembali
Command 3 : Maju
Command 4 : Refresh
Command 5 : Stop
Label 1 : Http://
Label 2 : Loading Bar)
- Masukin Code ini :
Untuk Button Kembali :
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
------------------------------
-Untuk Button Maju :
Private Sub Maju_Click()
On Error Resume Next
WebBrowser1.GoForward
End Sub
------------------------------
-Untuk Button Stop :
Private Sub Stop_Click()
On Error Resume Next
WebBrowser1.Stop
End Sub
------------------------------
-Untuk Button Refresh :
Private Sub refresh_Click()
On Error Resume Next
WebBrowser1.refresh
End Sub
------------------------------
-Klik 2x di web browser dan masukan code di bawah ini :
Private Sub WebBrowser1_ProgressChange(ByV
On Error Resume Next
If Progress = -1 Then ProgressBar1.Value = 100
Label1.Caption = "Loading Bar"
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
- Klik F5 untuk mencoba project berhasil atau tidak.. jika berhasil klik File --> Make Project1.exe
jika berhasil project akan seperti ini
Tidak ada komentar:
Posting Komentar