Public VBInstance As VBIDE.VBE
Public Connect As Connect
Option Explicit
Private Sub CancelButton_Click()
Connect.Hide
End Sub
Private Sub OKButton_Click()
ObjectInContainerSample
End Sub
Private Sub ObjectInContainerSample()
'menambahkan PictureBox
Dim f As VBForm
Dim p As VBControl
Dim b As VBControl
Set f = VBInstance.SelectedVBComponent.Designer
Set p = f.VBControls.Add("Frame")
With p
.Properties("Height") = 2000
.Properties("Width") = 4000
.Properties("Left") = 500
.Properties("Top") = 500
.Properties("Caption") = "Data Siswa"
'.properties dan lain-lain
End With
'menambahkan CommandButton
Set b = f.VBControls.Add("CommandButton")
Set b.Container = p 'memasukan sebuah objek ke dalam kontainer
With b
.Properties("Left") = 500
.Properties("Top") = 500
.Properties("Caption") = "&Simpan"
'.properties dan lain-lain
End With
End Sub
Tuesday, June 12, 2012
Memasukan Sebuah Object ke dalam Container - Addins VB6
Labels:
Add-Ins-VB6