Article ID: 192682
Article Last Modified on 5/13/2003
Event Click(X As Variant)
Private Sub Command1_Click()
Dim MyValue As Long ' Notice MyValue is declared as Long
MyValue = 1
MsgBox "Value before event is raised: " & MyValue
RaiseEvent Click(MyValue)
MsgBox "Value after then event returns: " & MyValue
End Sub
Dim WithEvents DynCtl As VBControlExtender
Private Sub Form_Load()
Set DynCtl = Controls.Add("Project2.UserControl1", "Tester")
DynCtl.Visible = True
End Sub
Private Sub DynCtl_ObjectEvent(Info As EventInfo)
' Change the ByRef value to 1000000
Info.EventParameters.Item(0).Value = 1000000
MsgBox "Value after change in ObjectEvent: " & _
Info.EventParameters.Item(0).Value
End Sub
190670 : HOWTO: Dynamically Add Controls to a Form with Visual Basic 6.0
Additional query words: kbDSupport kbDSD kbVBp kbCtrl kbVBp600bug
Keywords: kbbug KB192682