Thursday, December 6, 2012

VB6 Code - Menambah Internet Explorer Pada Saat Runtime

Contoh kode VB6 sederhana untuk dikembangkan mengenai cara menambah objek internet explorer pada saat runtime.
Option Explicit

Private IE As VBControlExtender

Private Sub Form_Load()
On Error GoTo IEMissing
Set IE = Form1.Controls.Add("Shell.Explorer", "wcIE")
IE.Visible = True
If Not IE Is Nothing Then
IE.object.silent = True
IE.object.Navigate "http://khoiriyyah.blogspot.com"
End If
IEMissing:

End Sub

Private Sub Form_Resize()
If Not IE Is Nothing Then
IE.Move 0, 0, Me.ScaleWidth, Me.ScaleHeight
End If
End Sub