problem in Dynamically adding objects of user control
-
Hello EveryBody I implemented one ActiveX Control in Visual Basic 6.0. And I want to add instances of this control (Dynamically) in new control or new form. But VB is not allowing me to Set object to ActiveX control. (it allow to declare object but problem is in set operation).:eek:...every suggtion and help is regreated..
-
Hello EveryBody I implemented one ActiveX Control in Visual Basic 6.0. And I want to add instances of this control (Dynamically) in new control or new form. But VB is not allowing me to Set object to ActiveX control. (it allow to declare object but problem is in set operation).:eek:...every suggtion and help is regreated..
You might want to post the code your using so we can see what's going on. Adding the control is as easy as
Dim myControl As New myActiveXControl
and then adding it to the Form's controls collection. RageInTheMachine9532 "...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome -
Hello EveryBody I implemented one ActiveX Control in Visual Basic 6.0. And I want to add instances of this control (Dynamically) in new control or new form. But VB is not allowing me to Set object to ActiveX control. (it allow to declare object but problem is in set operation).:eek:...every suggtion and help is regreated..
Here try this it should allow you to create infinate instances of and object using a dynamic array... (First of all set the index property of your ActiveX object to 0) {
Private Sub CreateNewActiveXObjectInstance() Load ActiveXObject(ActiveXObject.UBound + 1) 'Object Upper-Boundary increases by 1 now ActiveXObject(ActiveXObject.UBound) = ActiveXObject(ActiveXObject.UBound - 1) 'If the previous line gives you an ERROOOOOORRRRRGH! then try setting 'the properties of the new object, bearing in mind you have just created 'a new instance in memory, all of its property values will be empty. 'e.g. ActiveXObject (ActiveXObject.UBound).[Property] = [Value] End Sub
Call this routine everytime you want to create a new instance of the object :) };