Membuat WebBrowser di VB.NET
Hari ini kita akan membuat browser sederhana menggunakan VB.NET,untuk membuatnya tidaklah sulit.
Buka VB.NET anda
Pilih File->New Project->Windows Form Application->beri nama "Browser"
Tambahakan 1 buah combobox,2 buah button dan 1 buah webbrowser
Edit properties :
Form1
Size : 1370, 750
WindowsState : Maximized
Button1
Text : Back
Button2
Text : Forward
Masukan coding seperti berikut :
Buka VB.NET anda
Pilih File->New Project->Windows Form Application->beri nama "Browser"
Tambahakan 1 buah combobox,2 buah button dan 1 buah webbrowser
Edit properties :
Form1
Size : 1370, 750
WindowsState : Maximized
Button1
Text : Back
Button2
Text : Forward
Masukan coding seperti berikut :
Public Class Form1
Private Sub Button2_Click(sender As System.Object, e As System.EventArgs) Handles Button2.Click
WebBrowser1.GoForward()
End Sub
Private Sub Button1_Click(sender As System.Object, e As System.EventArgs) Handles Button1.Click
WebBrowser1.GoBack()
End Sub
Private Sub ComboBox1_KeyPress(sender As Object, e As System.Windows.Forms.KeyPressEventArgs) Handles ComboBox1.KeyPress
If e.KeyChar = Microsoft.VisualBasic.ChrW(13) Then
WebBrowser1.Navigate(ComboBox1.Text)
ComboBox1.Items.Add("http://" & ComboBox1.Text & "/")
End If
End Sub
Private Sub Form1_Load(sender As System.Object, e As System.EventArgs) Handles MyBase.Load
WebBrowser1.Navigate("vbnetsite.blogspot.com")
ComboBox1.Text = "vbnetsite.blogspot.com"
ComboBox1.Focus()
End Sub
End Class
{ 0 comments... read them below or add one }
Post a Comment