Posted by : Unknown Saturday, 22 February 2014

Setiap format dalam file komputer memiliki Program Dafault nya masing masing. Begitu juga Web Browser, setiap komputer kita masing masing memiliki Web Browser Dafault yang berbeda beda





Module yang diperlukan

Private Declare Function ShellExecute Lib "shell32.dll" Alias "ShellExecuteA" (ByVal hwnd As Long, ByVal lpOperation As String, ByVal lpFile As String, ByVal lpParameters As String, ByVal lpDirectory As String, ByVal nShowCmd As Long) As Long
Public Sub OpenBrowser(ByVal URL As String)
    Dim res As Long
    res = ShellExecute(0&, "open", URL, vbNullString, vbNullString, vbNormalFocus)
End Sub

Contoh

OpenBrowser "http://www.google.Com"

Membuat Hyperlink

1. Tambahkan Label (Lable1)
2. Tambahkan Code seperti berikut

Private Sub Form_Load()
    Label1.ForeColor = vbBlue
    Label1.FontUnderline = True
    Label1.Caption = "Google.Com"
End Sub
Private Sub Label1_Click()
    OpenBrowser "Google.Com"
End Sub

Source Code

Leave a Reply

Subscribe to Posts | Subscribe to Comments

Popular Post